<jupyter_start><jupyter_text>Epoch<jupyter_code>model = make_model()
model.to(trainer.device)
optimizer = torch.optim.Adam(model.parameters(), 1e-3, weight_decay=1e-5)
logger = Logger("SGD_momentum_adam.txt")
epochs = 30

for epoch in range(epochs):
    train_loss = trainer.train_epoch(model, optimizer, dl["train"])
    val_acc, val_loss = trainer.validation(model, dl["valid"])
    logger.log("Epoch", epoch+1, "|", 
          f"Training loss: {train_loss:.4f}, validation accuracy: {val_acc:.4f}, validation loss: {val_loss:.4f}")
train_score = trainer.validation(model, dl["train"])
valid_score = trainer.validation(model, dl["valid"])
logger.log("Train:", train_score)
logger.log("Valid:", valid_score)<jupyter_output>Train: (0.9985833333333334, 0.004241814148521134)
Valid: (0.9895833333333334, 0.06418128799728837)
{'fraction_non_alphanumeric': 0.16180048661800486, 'fraction_numerical': 0.09854014598540146, 'mean_word_length': 6.913461538461538, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '159593', 'license': 'MIT', 'n_tokens_mistral': 355, 'n_tokens_neox': 300, 'n_words': 49, 'path': 'notebooks/nn/SGD_adam.ipynb', 'repo_name': 'JaworWr/MLAcceleration', 'size': '822'}