| @@ -4,15 +4,15 @@ from matplotlib import pyplot as plt | |||
| import numpy as np | |||
| import optuna | |||
| densite = 10 | |||
| densite = 100 | |||
| start1 = 5 | |||
| stop1 = 15 | |||
| start2 = 35 | |||
| stop2 = 45 | |||
| start1 = 15 | |||
| stop1 = 35 | |||
| start2 = 55 | |||
| stop2 = 75 | |||
| start = -50 | |||
| stop = 150 | |||
| start = 0 | |||
| stop = 100 | |||
| training = [np.concatenate((np.linspace(start1, stop1, (stop1-start1)*densite), | |||
| np.linspace(start2, stop2, (stop2-start2)*densite)))] | |||
| @@ -42,8 +42,8 @@ mse = tf.keras.losses.MeanSquaredError() | |||
| def objectif(trial) : | |||
| HIDDEN = trial.suggest_int('hidden',64,512) | |||
| SIZE = trial.suggest_int('size',0,2) | |||
| HIDDEN = trial.suggest_int('hidden',32,128) | |||
| SIZE = trial.suggest_int('size',0,4) | |||
| DROPOUT = trial.suggest_float('dropout', 0,0.3) | |||
| model = tf.keras.Sequential() | |||
| model.add(tf.keras.layers.Dense(HIDDEN, input_shape=(1,), activation=tfa.activations.snake)) | |||
| @@ -59,7 +59,7 @@ def objectif(trial) : | |||
| metrics=['mse']) | |||
| history = model.fit(x=training[0], y=training[1], batch_size=4, | |||
| epochs=3000, shuffle=True, | |||
| epochs=100, shuffle=True, | |||
| #validation_data=(validation[0], validation[1]), | |||
| verbose='auto') | |||