OrmaosDocs

Examples

ml-training

A small PyTorch model trained on CPU to predict delivery minutes, and its recording.

View as Markdown

A PyTorch model, trained on CPU, that predicts the minutes a delivery takes from four features: distance, number of parcels, hour of the day and a weekend flag. The data is made by the script, the same every time. Each batch of 8 rows is standardized, the model takes one Adam step per batch, and a batch whose loss is not a finite number is left out. The weights are saved to model.pt. The loss can differ in the last digits from one build of torch to another.

Run it#

bash
python train.py
ml-training
$ python train.py
trained 40 steps, last loss 379.2, checkpoint model.pt

Recorded#

bash
ormaos run -- python train.py
ml-training
$ ormaos run -- python train.py
trained 40 steps, last loss 379.2, checkpoint model.pt
ormaos: r1 exit 0 in …: 1 Python process, 203 calls, 0 exceptions, 10 io
ormaos: not collected: logs with no line of user code: 5 logging records were asked for with no frame of user code waiting (library threads, the end of the interpreter): they are counted here and not recorded; the first loggers: torch._dynamo.eval_frame, torch._dynamo.utils, torch._subclasses.fake_tensor
ormaos: saved in .ormaos/r1, next: ormaos tree r1:c1
ml-training
$ ormaos show
r1 exit 0 in …: 1 Python process, 203 calls, 0 exceptions (0 swallowed, 0 uncaught)
command: python train.py
code: git commit not read (the working directory is not inside a git repository)
io: 10 events (file 10)
tensors: an array or a tensor was an argument or a result 400 times, 10 with NaN or inf: return of standardize at train.py:32  [r1:c56]
not collected: logs with no line of user code: 5 logging records were asked for with no frame of user code waiting (library threads, the end of the interpreter): they are counted here and not recorded; the first loggers: torch._dynamo.eval_frame, torch._dynamo.utils, torch._subclasses.fake_tensor
never recorded: values, and 20 more kinds of things (`ormaos show --full` lists them with the reason)
next: ormaos tree r1:c1 | ormaos io r1 | ormaos tree r1:c56