Skip to content

Commit

Permalink
Katib: Update namespace in getting started guide (#3765)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Velichkevich <[email protected]>
  • Loading branch information
andreyvelich authored Jun 15, 2024
1 parent 5fce381 commit 6be88bd
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions content/en/docs/components/katib/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ $$

The bigger \(a\) and the lesser \(b\) value, the bigger the function value \(F\).

If you install Katib as part of Kubeflow Platform, you can open a new
[Kubeflow Notebook](/docs/components/notebooks/quickstart-guide/) to run this script. If you
install Katib standalone, make sure that you
If you install Katib standalone, make sure that you
[configure local `kubeconfig`](https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#programmatic-access-to-the-api)
to access your Kubernetes cluster where you installed Katib control plane.

If you install Katib as part of Kubeflow Platform, you can open a new
[Kubeflow Notebook](/docs/components/notebooks/quickstart-guide/) to run this script.

**Note**. If you use Katib within Kubeflow Platform to run this example, you need to use this
namespace: `KatibClient(namespace="kubeflow-user-example-com")`.

```python
# [1] Create an objective function.
def objective(parameters):
Expand All @@ -55,8 +59,10 @@ parameters = {
}

# [3] Create Katib Experiment with 12 Trials and 2 CPUs per Trial.
katib_client = KatibClient(namespace="kubeflow")

name = "tune-experiment"
katib.KatibClient().tune(
katib_client.tune(
name=name,
objective=objective,
parameters=parameters,
Expand All @@ -66,10 +72,10 @@ katib.KatibClient().tune(
)

# [4] Wait until Katib Experiment is complete
katib.KatibClient().wait_for_experiment_condition(name=name)
katib_client.wait_for_experiment_condition(name=name)

# [5] Get the best hyperparameters.
print(katib.KatibClient().get_optimal_hyperparameters(name))
print(katib_client.get_optimal_hyperparameters(name))
```

You should get similar output for the most optimal Trial, hyperparameters, and observation metrics:
Expand Down

0 comments on commit 6be88bd

Please sign in to comment.