Skip to content

Commit

Permalink
rename logcosh to LogCosh
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkokotila committed Apr 21, 2024
1 parent fcb9e31 commit a59f0ae
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/Examples_Generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ return out, model
```python
p = {'activation':['relu', 'elu'],
'optimizer': ['Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'shapes': ['brick'],
'first_neuron': [32],
'dropout': [.2, .3],
Expand Down
2 changes: 1 addition & 1 deletion docs/Examples_Generator_Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def mnist_model(x_train, y_train, x_val, y_val, params):

p = {'activation':['relu', 'elu'],
'optimizer': ['Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'shapes': ['brick'],
'first_neuron': [32],
'dropout': [.2, .3],
Expand Down
2 changes: 1 addition & 1 deletion docs/Examples_PyTorch.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ return net, net.parameters()
```python
p = {'activation':['relu', 'elu'],
'optimizer': ['Adagrad', 'Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'hidden_layers':[0, 1, 2],
'batch_size': (20, 50, 5),
'epochs': [10, 20]}
Expand Down
2 changes: 1 addition & 1 deletion docs/Examples_PyTorch_Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def breast_cancer(x_train, y_train, x_val, y_val, params):

p = {'activation':['relu', 'elu'],
'optimizer': ['Adagrad', 'Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'hidden_layers':[0, 1, 2],
'batch_size': (20, 50, 5),
'epochs': [10, 20]}
Expand Down
2 changes: 1 addition & 1 deletion docs/Examples_Typical.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ return out, model
```python
p = {'activation':['relu', 'elu'],
'optimizer': ['Adagrad', 'Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'hidden_layers':[0, 1, 2],
'batch_size': (20, 50, 5),
'epochs': [10, 20]}
Expand Down
2 changes: 1 addition & 1 deletion docs/Hidden_Layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When hidden layers are used, `dropout`, `shapes`, `hidden_layers`, and `first_ne

p = {'activation':['relu', 'elu'],
'optimizer': ['Adagrad', 'Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'shapes': ['brick'], # <<< required
'first_neuron': [32, 64], # <<< required
'hidden_layers':[0, 1, 2], # <<< required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"source": [
"from tensorflow.keras.optimizers.legacy import Adam, Adagrad\n",
"from tensorflow.keras.activations import softmax\n",
"from tensorflow.keras.losses import categorical_crossentropy, logcosh\n",
"from tensorflow.keras.losses import categorical_crossentropy, LogCosh\n",
"\n",
"p = {'lr': (0.1, 10, 10),\n",
" 'first_neuron':[4, 8, 16, 32, 64, 128],\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/Recover Best Models from Experiment Log.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"# set the parameter space boundary\n",
"p = {'activation':['relu', 'elu'],\n",
" 'optimizer': ['Adagrad', 'Adam'],\n",
" 'losses': ['logcosh'],\n",
" 'losses': ['LogCosh'],\n",
" 'shapes': ['brick'],\n",
" 'first_neuron': [16, 32, 64, 128],\n",
" 'hidden_layers':[0, 1, 2, 3],\n",
Expand Down
2 changes: 1 addition & 1 deletion talos/autom8/autoparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from tensorflow.keras.optimizers.legacy import Adam, Adagrad, SGD


loss = {'binary': ['binary_crossentropy', 'logcosh'],
loss = {'binary': ['binary_crossentropy', 'LogCosh'],
'multi_class': ['sparse_categorical_crossentropy'],
'multi_label': ['categorical_crossentropy'],
'continuous': ['mae']}
Expand Down
12 changes: 6 additions & 6 deletions talos/templates/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def titanic(debug=False):
'dropout': (0, 0.5, 5),
'optimizer': [Adam(), Adagrad()],
'epochs': [50, 100, 150],
'losses': ['logcosh', 'binary_crossentropy'],
'losses': ['LogCosh', 'binary_crossentropy'],
'shapes': ['brick', 'triangle', 0.2],
'hidden_layers': [0, 1, 2, 3, 4],
'activation': ['relu', 'elu'],
Expand All @@ -23,7 +23,7 @@ def titanic(debug=False):
'dropout': [0.2, 0.3],
'optimizer': [Adam(), Adagrad()],
'epochs': [50, 100],
'losses': ['logcosh', 'binary_crossentropy'],
'losses': ['LogCosh', 'binary_crossentropy'],
'shapes': ['brick', 'triangle', 0.2],
'hidden_layers': [0, 1],
'activation': ['relu', 'elu'],
Expand All @@ -35,7 +35,7 @@ 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.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 +49,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 +59,7 @@ 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.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 +71,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
2 changes: 1 addition & 1 deletion tests/commands/test_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_latest():

p = {'activation': ['relu', 'elu'],
'optimizer': ['Adagrad', 'Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'shapes': ['brick'],
'first_neuron': [16, 32, 64, 128],
'hidden_layers': [0, 1, 2, 3],
Expand Down
6 changes: 3 additions & 3 deletions tests/commands/test_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ def test_rest(scan_object):
model1 = Sequential()
model1.add(Dense(10, input_dim=x.shape[1]))
model1.add(Dense(1))
model1.compile('adam', 'logcosh', metrics=metrics)
model1.compile('adam', 'LogCosh', metrics=metrics)
model1.fit(x, y, callbacks=callbacks)

print('\n ...generator... \n')

model2 = Sequential()
model2.add(Dense(10, input_dim=x.shape[1]))
model2.add(Dense(1))
model2.compile('adam', 'logcosh')
model2.compile('adam', 'LogCosh')
model2.fit_generator(talos.utils.generator(x, y, 10), 5)

print('\n ...SequenceGenerator... \n')

model3 = Sequential()
model3.add(Dense(10, input_dim=x.shape[1]))
model3.add(Dense(1))
model3.compile('adam', 'logcosh')
model3.compile('adam', 'LogCosh')
model3.fit_generator(talos.utils.SequenceGenerator(x, y, 10))

print('\n ...gpu_utils... \n')
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_scan():

p = {'activation': [relu, elu],
'optimizer': ['Adagrad', Adam],
'losses': ['logcosh', binary_crossentropy],
'losses': ['LogCosh', binary_crossentropy],
'shapes': ['brick', 'funnel', 'triangle'],
'first_neuron': [16],
'hidden_layers': ([0, 1, 2, 3]),
Expand Down Expand Up @@ -51,7 +51,7 @@ def iris_model(x_train, y_train, x_val, y_val, params):

p_for_q = {'activation': ['relu', 'elu'],
'optimizer': ['Adagrad', 'Adam'],
'losses': ['logcosh'],
'losses': ['LogCosh'],
'shapes': ['brick'],
'first_neuron': [16, 32, 64, 128],
'hidden_layers': [0, 1, 2, 3],
Expand Down

0 comments on commit a59f0ae

Please sign in to comment.