Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion downstream/AoANet_VC/misc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def __getattr__(self, name):
class ReduceLROnPlateau(object):
"Optim wrapper that implements rate."
def __init__(self, optimizer, mode='min', factor=0.1, patience=10, verbose=False, threshold=0.0001, threshold_mode='rel', cooldown=0, min_lr=0, eps=1e-08):
self.scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode, factor, patience, verbose, threshold, threshold_mode, cooldown, min_lr, eps)
self.scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode, factor, patience, threshold, threshold_mode, cooldown, min_lr, eps, verbose)
self.optimizer = optimizer
self.current_lr = get_lr(optimizer)

Expand Down
5 changes: 3 additions & 2 deletions downstream/AoANet_VC/models/AttModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@

def sort_pack_padded_sequence(input, lengths):
sorted_lengths, indices = torch.sort(lengths, descending=True)
tmp = pack_padded_sequence(input[indices], sorted_lengths, batch_first=True)
sorted_lengths=sorted_lengths.to(int)
tmp = pack_padded_sequence(input[indices], sorted_lengths.cpu(), batch_first=True)
inv_ix = indices.clone()
inv_ix[indices] = torch.arange(0,len(indices)).type_as(inv_ix)
return tmp, inv_ix
Expand Down Expand Up @@ -791,4 +792,4 @@ def core(self, xt, fc_feats, att_feats, p_att_feats, state, att_masks):
def _prepare_feature(self, fc_feats, att_feats, att_masks):
fc_feats = self.fc_embed(fc_feats)

return fc_feats, None, None, None
return fc_feats, None, None, None