From adc1de26671620ae7b47e753a9d1543b7891e3a6 Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 24 May 2023 17:30:44 -0400 Subject: [PATCH] train --- README.md | 18 ++++++++++++++++++ Sophia/__init__.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 68c4bd3..01ad1f4 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,24 @@ for epoch in range(epochs): optimizer.step() ``` +## Training: +To run training use git clone method and navigate to experiments folder and if not then do the following: + +```python +from Sophia import DecoupledSophia, trainer + + +#train model +trainer.train() + + +#eval the model +eval_results = trainer.evaluate() +print(f"Perplexity: {torch.exp(torch.tensor(eval_results['eval_loss']))}") + +``` + + # Algorithmic pseudocode: ``` diff --git a/Sophia/__init__.py b/Sophia/__init__.py index 59e19d1..9d22a20 100644 --- a/Sophia/__init__.py +++ b/Sophia/__init__.py @@ -1,3 +1,3 @@ from Sophia.Sophia import Sophia from decoupled_sophia.decoupled_sophia import DecoupledSophia -from experiments.training import \ No newline at end of file +from experiments.training import trainer \ No newline at end of file