# In[7]:


classifier = Net()


# In[8]:


learn = Learner(
    data_bunch,
    classifier,
    loss_func=Loss_combine_weighted_v2(),
    opt_func=Over9000,
    metrics=[Metric_grapheme(), Metric_vowel(), Metric_consonant(), Metric_tot()]
)

name = 'new_baseline_hengs_LessAugs_211_Mu10_Wd0_fit160epochs'

logger = CSVLogger(learn, name)

# learn.unfreeze()


# In[ ]:


# learn.fit_one_cycle(
#     64,
#     max_lr=.01,
classifier = mdl_res34_localpool()

classifier.load_state_dict(
    torch.load(
        'mdl_res34localpool_168168_lessaugs_mucm_fixed_adam_onecycle_fld3of5_backup.pth'
    ))

learn = Learner(data_bunch,
                classifier,
                loss_func=Loss_combine_weighted_v2(),
                opt_func=Adam,
                metrics=[
                    Metric_grapheme(),
                    Metric_vowel(),
                    Metric_consonant(),
                    Metric_tot()
                ])

# learn.clip_grad = 1.0
name = 'mdl_res34localpool_168168_lessaugs_mucm_fixed_adam_onecycle_fld3of5'

logger = CSVLogger(learn, name)

# =========================================================================================

# learn.fit_one_cycle(
#     100,
#     max_lr=0.001,
#     wd=0.0,
#     pct_start=0.0,
#     div_factor=100.,