mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Make the probability to select a batch from GigaSpeech configurable.
This commit is contained in:
parent
981bf74364
commit
61b0019ffd
@ -161,6 +161,13 @@ def get_parser():
|
|||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
"--giga-prob",
|
||||||
|
type=float,
|
||||||
|
default=0.2,
|
||||||
|
help="The probability to select a batch from the GigaSpeech dataset",
|
||||||
|
)
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
@ -523,7 +530,7 @@ def train_one_epoch(
|
|||||||
# index 0: for LibriSpeech
|
# index 0: for LibriSpeech
|
||||||
# index 1: for GigaSpeech
|
# index 1: for GigaSpeech
|
||||||
# This sets the probabilities for choosing which datasets
|
# This sets the probabilities for choosing which datasets
|
||||||
dl_weights = [0.8, 0.2]
|
dl_weights = [1 - params.giga_prob, params.giga_prob]
|
||||||
|
|
||||||
iter_libri = iter(train_dl)
|
iter_libri = iter(train_dl)
|
||||||
iter_giga = iter(giga_train_dl)
|
iter_giga = iter(giga_train_dl)
|
||||||
@ -861,6 +868,8 @@ def main():
|
|||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
args.exp_dir = Path(args.exp_dir)
|
args.exp_dir = Path(args.exp_dir)
|
||||||
|
|
||||||
|
assert 0 < args.giga_prob < 1, args.giga_prob
|
||||||
|
|
||||||
world_size = args.world_size
|
world_size = args.world_size
|
||||||
assert world_size >= 1
|
assert world_size >= 1
|
||||||
if world_size > 1:
|
if world_size > 1:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user