mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-10-29 09:38:56 +08:00
Transformer experiment logs (#130)
This commit is contained in:
@ -108,6 +108,7 @@ class NLPAutoRegressionConfigs(TrainValidConfigs):
|
||||
# Set tracker configurations
|
||||
tracker.set_scalar("accuracy.*", True)
|
||||
tracker.set_scalar("loss.*", True)
|
||||
tracker.set_text("sampled", False)
|
||||
# Add a hook to log module outputs
|
||||
hook_model_outputs(self.mode, self.model, 'model')
|
||||
# Add accuracy as a state module.
|
||||
@ -192,6 +193,7 @@ class NLPAutoRegressionConfigs(TrainValidConfigs):
|
||||
# Add the prediction for logging
|
||||
log += [(self.prompt_separator + self.text.itos[output[-1]], Text.value)]
|
||||
|
||||
tracker.add({'sampled': prompt})
|
||||
# Print the sampled output
|
||||
logger.log(log)
|
||||
|
||||
|
||||
@ -52,7 +52,11 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"pycharm": {
|
||||
"name": "#%% md\n"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"### Enable [Comet](https://www.comet.ml)"
|
||||
]
|
||||
@ -60,7 +64,11 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"pycharm": {
|
||||
"name": "#%%\n"
|
||||
}
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#@markdown Select in order to enable logging this experiment to [Comet](https://www.comet.ml).\n",
|
||||
@ -317,4 +325,4 @@
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user