Path flags
`train_path`, `test_path`, and `model_path` define where Omniglot data is read from and where checkpoints are written.
Training chapter
Flag parsing, dataloaders, BCEWithLogitsLoss, DataParallel, checkpoints, and test precision.
Module boundary
The script handles flag parsing, path selection, dataloader creation, optimizer setup, checkpointing, intermediate evaluation, and final accuracy reporting.
Runtime flags
`train_path`, `test_path`, and `model_path` define where Omniglot data is read from and where checkpoints are written.
`show_every`, `save_every`, `test_every`, and `max_iter` determine how often loss is printed, checkpoints are saved, and evaluation runs are executed.
Optimization
The model emits raw logits and the script applies `torch.nn.BCEWithLogitsLoss` directly, which keeps the sigmoid inside the numerically stable loss function.
The training loop uses Adam rather than SGD with momentum, which is one of the documented reasons the final metric differs from the paper.
If multiple GPU ids are provided, the script wraps the network with `torch.nn.DataParallel` after constructing the Siamese model.
Evaluation and artifacts
For each test episode, the model compares all candidates and treats the prediction as correct only if `np.argmax(output)` returns the first item.
The script saves intermediate weights under names like `model-inter-