@@ -71,42 +71,22 @@ class CloudOracle(oracle_module.Oracle):
71
71
many different hyperparameters, it can be difficult and time consuming to
72
72
tune them manually. AI Platform Vizier optimizes your model's output by
73
73
tuning the hyperparameters for you.
74
- To learn more about AI Platfrom Vizier service see:
74
+ To learn more about AI Platform Vizier service see:
75
75
https://cloud.google.com/ai-platform/optimizer/docs/overview.
76
76
77
- Examples:
78
- >>> oracle = CloudOracle(
79
- project_id=project_id,
80
- region='us-central1',
81
- objective='accuracy',
82
- hyperparameters=hyperparameters,
83
- study_config=None,
84
- max_trials=4,
85
- study_id=None,
86
- )
87
-
88
- Args:
89
- project_id: A GCP project id.
90
- region: A GCP region. e.g. 'us-central1'.
91
- objective: If a string, the direction of the optimization (min or
92
- max) will be inferred.
93
- hyperparameters: Mandatory and must include definitions for all
94
- hyperparameters used during the search. Can be used to override
95
- (or register in advance) hyperparameters in the search space.
96
- study_config: Study configuration for Vizier service.
97
- max_trials: Total number of trials (model configurations) to test at
98
- most. If None, it continues the search until it reaches the
99
- Vizier trial limit for each study. Users may stop the search
100
- externally (e.g. by killing the job). Note that the Oracle may
101
- interrupt the search before `max_trials` models have been
102
- tested.
103
- study_id: An identifier of the study. If not supplied,
104
- system-determined unique ID is given.
105
- The full study name will be
106
- `projects/{project_id}/locations/{region}/studies/{study_id}`,
107
- and the full trial name will be
108
- `{study name}/trials/{trial_id}`.
109
- )
77
+ Examples:
78
+
79
+ ```
80
+ oracle = CloudOracle(
81
+ project_id=project_id,
82
+ region='us-central1',
83
+ objective='accuracy',
84
+ hyperparameters=hyperparameters,
85
+ study_config=None,
86
+ max_trials=4,
87
+ study_id=None,
88
+ )
89
+ ```
110
90
"""
111
91
112
92
def __init__ (
@@ -132,15 +112,18 @@ def __init__(
132
112
https://keras-team.github.io/keras-tuner/documentation/oracles/
133
113
134
114
Examples:
135
- >>> oracle = CloudOracle(
136
- project_id=project_id,
137
- region='us-central1',
138
- objective='accuracy',
139
- hyperparameters=hyperparameters,
140
- study_config=None,
141
- max_trials=4,
142
- study_id=None,
143
- )
115
+
116
+ ```
117
+ oracle = CloudOracle(
118
+ project_id=project_id,
119
+ region='us-central1',
120
+ objective='accuracy',
121
+ hyperparameters=hyperparameters,
122
+ study_config=None,
123
+ max_trials=4,
124
+ study_id=None,
125
+ )
126
+ ```
144
127
145
128
Args:
146
129
project_id: A GCP project id.
@@ -450,37 +433,22 @@ class CloudTuner(tuner_module.Tuner):
450
433
CloudTuner is a implementation of KerasTuner that uses Google Cloud Vizier
451
434
Service as its Oracle. To learn more about KerasTuner and Oracles please
452
435
refer to:
453
- https://keras-team.github.io/keras-tuner/
454
- https://keras-team.github.io/keras-tuner/documentation/oracles/
455
-
456
- Args:
457
- hypermodel: Instance of HyperModel class (or callable that takes
458
- hyperparameters and returns a Model instance).
459
- project_id: A GCP project id.
460
- region: A GCP region. e.g. 'us-central1'.
461
- objective: Name of model metric to minimize or maximize, e.g.
462
- "val_accuracy".
463
- hyperparameters: Can be used to override (or register in advance)
464
- hyperparameters in the search space.
465
- study_config: Study configuration for Vizier service.
466
- max_trials: Total number of trials (model configurations) to test at
467
- most. Note that the oracle may interrupt the search before
468
- `max_trials` models have been tested if the search space has
469
- been exhausted.
470
- study_id: An identifier of the study. The full study name will be
471
- projects/{project_id}/locations/{region}/studies/{study_id}.
472
- **kwargs: Keyword arguments relevant to all `Tuner` subclasses.
473
- Please see the docstring for `Tuner`.
474
-
475
- Example:
476
- >>> tuner = CloudTuner(
477
- build_model,
478
- project_id="MY_PROJECT_ID",
479
- region='us-central1',
480
- objective='accuracy',
481
- hyperparameters=HPS,
482
- max_trials=5,
483
- directory='tmp/MY_JOB')
436
+
437
+ * https://keras-team.github.io/keras-tuner/
438
+ * https://keras-team.github.io/keras-tuner/documentation/oracles/
439
+
440
+ Example:
441
+
442
+ ```
443
+ tuner = CloudTuner(
444
+ build_model,
445
+ project_id="MY_PROJECT_ID",
446
+ region='us-central1',
447
+ objective='accuracy',
448
+ hyperparameters=HPS,
449
+ max_trials=5,
450
+ directory='tmp/MY_JOB')
451
+ ```
484
452
"""
485
453
486
454
def __init__ (
0 commit comments