twinlab.Emulator.export#

Emulator.export(file_path, format, observation_noise=None, verbose=True)[source]#

Export your emulator using a valid file format. Currently twinLab support exporting emulators in the following formats:

  • "torchscript": Export the emulator as a TorchScript model for easy inference in PyTorch. Please see the Pytorch documentation for more information on how to use TorchScript models.

Parameters:
  • file_path (str) – The local path to save the exported emulator.

  • format (str) – The format in which to export the emulator. Valid strings include "torchscript".

  • observation_noise (bool, optional) – If supported by your emulator, setting this to True means the emulator will be exported with observation noise.

  • verbose (bool, optional) – Display detailed information about the operation while running.

Return type:

None

Returns:

None

Examples

emulator = tl.Emulator("emulator_id")
emulator.train(dataset, inputs, outputs, params)
emulator.export("torchscript")