INNER CODE UNIT · Python

time_elapsed

yya518/FinBERT · archive/train_bert.py:110

    time_elapsed = time.time() - since
    print('Training complete in {:.0f}m {:.0f}s'.format(
        time_elapsed // 60, time_elapsed % 60))
    wo.write('Training complete in {:.0f}m {:.0f}s \n'.format(
        time_elapsed // 60, time_elapsed % 60))

    print('Best val Acc: {:8f}'.format(float(best_accuracy)))
    wo.write('Best val Acc: {:8f} \n'.format(float(best_accuracy)))
    print('Best val f1: {:8f}'.format(float(best_f1)))
    wo.write('Best val f1: {:8f} \n'.format(float(best_f1)))
    wo.close()
    
    # load best model weights
    model.load_state_dict(best_model_wts)

    return best_accuracy, best_f1

if __name__ == '__main__':

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…