# NOT RUN {
# Load the workspace
ws <- load_workspace_from_config()
# Get the compute target
compute_target <- get_compute(ws, cluster_name = 'mycluster')
# Define the primary metric goal
goal = primary_metric_goal("MAXIMIZE")
# Define the early termination policy
early_termination_policy = median_stopping_policy(evaluation_interval = 1L,
delay_evaluation = 5L)
# Create the estimator
est <- estimator(source_directory = '.',
entry_script = 'train.R',
compute_target = compute_target)
# Create the HyperDrive configuration
hyperdrive_run_config = hyperdrive_config(
hyperparameter_sampling = param_sampling,
primary_metric_name = 'accuracy',
primary_metric_goal = goal,
max_total_runs = 100,
max_concurrent_runs = 4,
policy = early_termination_policy,
estimator = est)
# Submit the HyperDrive experiment
exp <- experiment(ws, name = 'myexperiment')
run = submit_experiment(exp, hyperdrive_run_config)
# }
Run the code above in your browser using DataLab