diff --git a/docs/Examples_Multiple_Inputs.md b/docs/Examples_Multiple_Inputs.md index fdd1e10..1698a41 100644 --- a/docs/Examples_Multiple_Inputs.md +++ b/docs/Examples_Multiple_Inputs.md @@ -24,6 +24,8 @@ x_train, y_train, x_val, y_val = wrangle.array_split(x, y, .5) ``` In the case of multi-input models, the data must be split into training and validation datasets before using it in `Scan()`. `x` is expected to be a list of numpy arrays and `y` a numpy array. +**NOTE:** For full support of Talos features for multi-input models, set `Scan(...multi_input=True...)`. + ### Defining the Model ```python diff --git a/docs/Examples_Typical_Code.md b/docs/Examples_Typical_Code.md index 55dce6e..72bf421 100644 --- a/docs/Examples_Typical_Code.md +++ b/docs/Examples_Typical_Code.md @@ -3,18 +3,23 @@ # Typical Case Example ```python -import talos as ta +import talos as talos from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense -x, y = ta.templates.datasets.iris() +x, y = talos.templates.datasets.iris() +# define the model def iris_model(x_train, y_train, x_val, y_val, params): model = Sequential() + model.add(Dense(32, input_dim=4, activation=params['activation'])) model.add(Dense(3, activation='softmax')) - model.compile(optimizer=params['optimizer'], loss=params['losses']) + + model.compile(optimizer=params['optimizer'], + loss=params['losses'], + metrics=[talos.utils.metrics.f1score]) out = model.fit(x_train, y_train, batch_size=params['batch_size'], @@ -24,14 +29,20 @@ def iris_model(x_train, y_train, x_val, y_val, params): return out, model +# set the parameter space boundaries p = {'activation':['relu', 'elu'], - 'optimizer': ['Nadam', 'Adam'], - 'losses': ['logcosh'], - 'hidden_layers':[0, 1, 2], - 'batch_size': (20, 50, 5), - 'epochs': [10, 20]} - -scan_object = ta.Scan(x, y, model=iris_model, params=p, fraction_limit=0.1) + 'optimizer': ['Nadam', 'Adam'], + 'losses': ['categorical_crossentropy'], + 'epochs': [100, 200], + 'batch_size': [4, 6, 8]} + +# start the experiment +scan_object = talos.Scan(x=x, + y=y, + model=iris_model, + params=p, + experiment_name='iris', + round_limit=20) ``` `Scan()` always needs to have `x`, `y`, `model`, and `params` arguments declared. Find the description for all `Scan()` arguments [here](Scan.md#scan-arguments). diff --git a/docs/Predict.md b/docs/Predict.md index 10f5844..6f39876 100644 --- a/docs/Predict.md +++ b/docs/Predict.md @@ -34,5 +34,6 @@ Parameter | Default | Description `model_id` | None | the model_id to be used `metric` | None | the metric against which the validation is performed `asc` | None | should be True if metric is a loss +`task`| NA | One of the following strings: 'binary' or 'multi_class' `saved` | bool | if a model saved on local machine should be used `custom_objects` | dict | if the model has a custom object, pass it here diff --git a/docs/Scan.md b/docs/Scan.md index 60790c5..b07faa9 100644 --- a/docs/Scan.md +++ b/docs/Scan.md @@ -23,6 +23,7 @@ Argument | Input | Description `x_val` | array or list of arrays | validation data for x `y_val` | array or list of arrays | validation data for y `val_split` | float | validation data split ratio +`multi_input` | float | set to True if multi-input model `random_method` | str | the random method to be used `seed` | float | Seed for random states `performance_target` | list | A result at which point to end experiment diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 95d3ee2..61abf6e 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/talos_logo_bg.png) -## v1.2.5 +## v1.3 > Hyperparameter Experiments with Tensorflow, PyTorch and Keras diff --git a/docs/index.html b/docs/index.html index cc8e930..44848f7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -16,7 +16,7 @@