- Defining parameters allows you to easily rerun, sort, and keep track of executions based on the parameter values used to run them.
- You can easily create (or copy) an execution and change the parameters in the UI, without changing your code.
- Defining parameters allows you to start creating Tasks where you run multiple parallel executions with different parameter combinations.
- Each step has its own parameter configuration in
valohai.yaml
. - A parameter can be a type of a
string
,integer
,float
, andflag
(=boolean). - Parameters are passed as command-line arguments to your code.
- Edit how parameters are passed to your code using pass-as.
- You can also parse parameter values from YAML and JSON files inside your execution. See file-based configuration.
Define parameters in Python:
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--iterations', type=int, default=10)
return parser.parse_args()
args = parse_args()
print(args.iterations)
Create a valohai.yaml configuration files and define your step in it:
- step:
name: Train model
image: tensorflow/tensorflow:1.13.1
command: python myfile.py {parameters}
parameters:
- name: iterations
type: integer
default: 100
Comments
0 comments
Please sign in to leave a comment.