-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from JuliaAI/implementing-channel-control-for-…
…experiment-creation Implementing channel control for experiment creation
- Loading branch information
Showing
7 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
@testset verbose = true "multiprocessing" begin | ||
logger = MLJFlow.Logger(ENV["MLFLOW_TRACKING_URI"]; | ||
experiment_name="MLJFlow multiprocessing tests", | ||
artifact_location="/tmp/mlj-test") | ||
|
||
X, y = make_moons(100) | ||
DecisionTreeClassifier = @load DecisionTreeClassifier pkg=DecisionTree | ||
|
||
model = DecisionTreeClassifier() | ||
r = range(model, :max_depth, lower=1, upper=6) | ||
|
||
function test_tuned_model(acceleration_method) | ||
tuned_model = TunedModel( | ||
model=model, | ||
range=r, | ||
logger=logger, | ||
acceleration=acceleration_method, | ||
n=100, | ||
) | ||
tuned_model_mach = machine(tuned_model, X, y) | ||
fit!(tuned_model_mach) | ||
|
||
experiment = getorcreateexperiment(logger.service, logger.experiment_name) | ||
runs = searchruns(logger.service, experiment) | ||
|
||
@assert length(runs) == 100 | ||
|
||
deleteexperiment(logger.service, experiment) | ||
end | ||
|
||
@testset "log_evaluation_with_cpu_threads" begin | ||
test_tuned_model(CPUThreads()) | ||
end | ||
|
||
@testset "log_evaluation_with_cpu_processes" begin | ||
test_tuned_model(CPUProcesses()) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters