in src/fairseq/fairseq/models/wav2vec.py [0:0]
def add_args(parser):
"""Add model-specific arguments to the parser."""
parser.add_argument(
"--prediction-steps",
type=int,
metavar="N",
help="number of steps ahead to predict",
)
parser.add_argument(
"--sample-distance",
type=int,
metavar="N",
help="sample distance from target. does not work properly with cross-sampling",
)
parser.add_argument(
"--cross-sample-negatives",
type=int,
metavar="N",
help="num of cross sampled negatives",
)
parser.add_argument(
"--num-negatives", type=int, metavar="N", help="number of negative examples"
)
parser.add_argument(
"--conv-feature-layers",
type=str,
metavar="EXPR",
help="convolutional feature extraction layers [(dim, kernel_size, stride), ...]",
)
parser.add_argument(
"--conv-aggregator-layers",
type=str,
metavar="EXPR",
help="convolutional feature extraction layers [(dim, kernel_size, stride), ...]",
)
parser.add_argument(
"--dropout",
type=float,
metavar="D",
help="dropout to apply within the model",
)
parser.add_argument(
"--dropout-features",
type=float,
metavar="D",
help="dropout to apply to the features",
)
parser.add_argument(
"--dropout-agg",
type=float,
metavar="D",
help="dropout to apply after aggregation step",
)
parser.add_argument(
"--encoder", type=str, choices=["cnn"], help="type of encoder to use"
)
parser.add_argument(
"--aggregator",
type=str,
choices=["cnn", "gru"],
help="type of aggregator to use",
)
parser.add_argument(
"--gru-dim", type=int, metavar="N", help="GRU dimensionality"
)
parser.add_argument(
"--no-conv-bias",
action="store_true",
help="if set, does not learn bias for conv layers",
)
parser.add_argument(
"--agg-zero-pad",
action="store_true",
help="if set, zero pads in aggregator instead of repl pad",
)
parser.add_argument(
"--skip-connections-feat",
action="store_true",
help="if set, adds skip connections to the feature extractor",
)
parser.add_argument(
"--skip-connections-agg",
action="store_true",
help="if set, adds skip connections to the aggregator",
)
parser.add_argument(
"--residual-scale",
type=float,
metavar="D",
help="scales residual by sqrt(value)",
)
parser.add_argument(
"--log-compression",
action="store_true",
help="if set, adds a log compression to feature extractor",
)
parser.add_argument(
"--balanced-classes",
action="store_true",
help="if set, loss is scaled to balance for number of negatives",
)
parser.add_argument(
"--project-features",
choices=["none", "same", "new"],
help="if not none, features are projected using the (same or new) aggregator",
)
parser.add_argument(
"--non-affine-group-norm",
action="store_true",
help="if set, group norm is not affine",
)
parser.add_argument(
"--offset",
help="if set, introduces an offset from target to predictions. "
'if set to "auto", it is computed automatically from the receptive field',
)
parser.add_argument(
"--activation",
type=str,
choices=["relu", "gelu"],
help="which activation function to use",
)
parser.add_argument(
"--vq-type",
type=str,
choices=["none", "gumbel", "kmeans"],
help="which type of quantizer to use",
)
parser.add_argument(
"--vq-vars",
type=int,
metavar="N",
help="if set, project to this many vector quantized variables per group",
)
parser.add_argument(
"--vq-groups",
type=int,
metavar="N",
help="number of groups of latent variables",
)
parser.add_argument(
"--vq-dim",
type=int,
metavar="N",
help="uses this dimensionality for quantized vectors",
)
parser.add_argument(
"--vq-depth",
type=int,
metavar="N",
help="number of layers for vq weight projection",
)
parser.add_argument(
"--combine-groups",
action="store_true",
help="if set, variables are shared among groups",
)
parser.add_argument(
"--vq-temp",
type=str,
metavar="TEMP",
help="temperature for latent variable sampling with gumbel softmax. should be a tuple of 3 values (start, end, decay)",
)
parser.add_argument(
"--vq-gamma",
type=float,
metavar="D",
help="gamma parameter for kmeans style vector quantization",
)