View source: R/piece_transformer.R
| pt_transformer_load | R Documentation |
Reads a .pth saved by torch.save() and returns the model ready
to run. Everything that differs between torch's conventions and this
package's is resolved here rather than at inference time.
pt_transformer_load(path, layout = pt_cube4_layout(), ...)
path |
Path to the |
layout |
A layout list; defaults to |
... |
Passed to |
A pt_transformer with the checkpoint's weights.
pth_catalogue to see what a checkpoint holds.
## Not run:
model <- pt_transformer_load("model.pth")
q <- pt_forward(model, rep(0:5, each = 16))
which.max(q)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.