<jupyter_start><jupyter_text>Is on-the-fly padding better than global paddingOn-the-fly padding: pad every sample to the longest sample in the current batchglobal padding: pad to the longest sample in the whole datasetOn-the-fly padding is much better if the target is not reversed. It is slightly better if the target is reversed.<jupyter_code>luong.groupby(['language', 'reverse', 'new']).max()['dev_acc'].unstack(['reverse', 'new']).describe()
df = luong[(luong.reverse==False) & (luong.new==True)]
df.groupby('language').dev_acc.max().sort_values(ascending=False).tail(20)
high = df[df.train_size=='high']

high.groupby('language').dev_acc.max().sort_values(ascending=False).tail(20)
high[high['language'] == 'norwegian-nynorsk'].experiment_dir.str[-20:]<jupyter_output><empty_output><jupyter_text>Random parameter search<jupyter_code>luong_dir = "../exps/task1/luong_param_search/"
two_headed_dir = "../exps/task1/two_headed_param_search/"

hp_search = pd.concat([
    load_res_dir(luong_dir),
    #load_res_dir(two_headed_dir),
])

hp_search.shape
hp_search.groupby('language').dev_acc.max()
hp_search.groupby(['inflected_embedding_size', 'language'])[['dev_acc', 'train_acc']].agg(['mean', 'max', 'count'])
hp_search['overfit'] = (hp_search['train_acc'] - hp_search['dev_acc']) / hp_search['dev_acc']
hp_search.groupby(['model', 'language'])[['dev_acc', 'dev_loss', 'train_acc', 'train_loss']].agg(['mean', 'min', 'max', 'std'])
hp_search.groupby(['model', 'language']).running_time.describe()
hp_search.groupby(['share_vocab', 'model'])[['dev_acc', 'train_acc']].agg(['mean', 'max', 'std', 'count'])
hp_search.groupby(['early_stopping_ratio', 'model'])[['dev_acc', 'train_acc']].agg(['mean', 'max', 'std', 'count'])
hp_search['epochs_run'] = hp_search.train_loss.apply(len)
hp_search.hist('epochs_run')
def plot_losses(row):
    train_loss = row['train_loss']
    dev_loss = row['dev_loss']
    plt.plot(dev_loss)
    
plot_losses(hp_search.iloc[0])
for row in hp_search[(hp_search.train_loss.apply(len) > 30) & (hp_search.train_loss.apply(len) < 50)].iterrows():
    plot_losses(row[1])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19341176470588237, 'fraction_numerical': 0.006588235294117647, 'mean_word_length': 7.895397489539749, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '164128', 'license': 'MIT', 'n_tokens_mistral': 783, 'n_tokens_neox': 769, 'n_words': 121, 'path': 'notebooks/task1_results.ipynb', 'repo_name': 'juditacs/sigmorphon2018', 'size': '2125'}