Train¶
Training machine learning models often requires custom train loop and custom code. As such, we don’t provide an out of the box training loop app. We do however have examples for how you can construct your training app as well as generic components you can use to run your custom training app.
See
torchx.components
to learn more about authoring componentsFor more information on distributed training see
torchx.components.dist
.
Embedded Train Script¶
For simple apps you can use the torchx.components.utils.python()
component to embed the training script as a command line argument to the Python
command. This has a size limitation but works for many smaller apps.
>>> from torchx.components.utils import python
>>> app = """
... import sys
... print(f"Hello, {sys.argv[0]}")
... """
>>> python("TorchX user", c=app)
AppDef(..., entrypoint='python', ...)