in src/speech_reps/models/decoar2.py [0:0]
def __init__(self):
"""
input_size: an int indicating the input feature size, e.g., 80 for Mel.
hidden_size: an int indicating the RNN hidden size.
num_layers: an int indicating the number of RNN layers.
dropout: a float indicating the RNN dropout rate.
residual: a bool indicating whether to apply residual connections.
"""
super(DeCoAR2, self).__init__()
config = Config()
for arg_name, arg_val in args.items():
setattr(config, arg_name, arg_val)
self.post_extract_proj = nn.Linear(config.input_feat, config.encoder_embed_dim)
self.dropout_input = nn.Dropout(config.dropout_input)
self.encoder = TransformerEncoder(config)