Skip to content

Commit

Permalink
generalize loss init
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkokotila committed Apr 21, 2024
1 parent 427086b commit 87745f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 2 additions & 4 deletions talos/templates/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def titanic(debug=False):
def iris():

from tensorflow.keras.optimizers.legacy import Adam, Adagrad
from tensorflow.keras.losses import LogCosh, categorical_crossentropy
from tensorflow.keras.activations import relu, elu, softmax

# here use a standard 2d dictionary for inputting the param boundaries
Expand All @@ -49,7 +48,7 @@ def iris():
'emb_output_dims': [None],
'shapes': ['brick', 'triangle', 0.2],
'optimizer': [Adam, Adagrad],
'losses': [LogCosh, categorical_crossentropy],
'losses': ['LogCosh', 'categorical_crossentropy'],
'activation': [relu, elu],
'last_activation': [softmax]}

Expand All @@ -59,7 +58,6 @@ def iris():
def breast_cancer():

from tensorflow.keras.optimizers.legacy import Adam, Adagrad, RMSprop
from tensorflow.keras.losses import LogCosh, binary_crossentropy
from tensorflow.keras.activations import relu, elu, sigmoid

# then we can go ahead and set the parameter space
Expand All @@ -71,7 +69,7 @@ def breast_cancer():
'dropout': (0, 0.5, 5),
'shapes': ['brick', 'triangle', 'funnel'],
'optimizer': [Adam, Adagrad, RMSprop],
'losses': [LogCosh, binary_crossentropy],
'losses': ['LogCosh', 'binary_crossentropy'],
'activation': [relu, elu],
'last_activation': [sigmoid]}

Expand Down
1 change: 1 addition & 0 deletions tests/commands/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_templates():
talos.Scan(x, y, p, model, 'test_', round_limit=2)

x, y = talos.templates.datasets.iris()

x = x[:50]
y = y[:50]
model = talos.templates.models.iris
Expand Down

0 comments on commit 87745f0

Please sign in to comment.