Skip to content

Commit

Permalink
Define input_shape via Input call in Sequential model
Browse files Browse the repository at this point in the history
This is only for MLP for now.
  • Loading branch information
feranick committed Oct 8, 2024
1 parent 1483bf5 commit 7458220
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SpectraKeras/SpectraKeras_CNN.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''
**********************************************
* SpectraKeras_CNN Classifier and Regressor
* v2024.10.07.2
* v2024.10.08.1
* Uses: TensorFlow
* By: Nicola Ferralis <[email protected]>
**********************************************
Expand Down
5 changes: 3 additions & 2 deletions SpectraKeras/SpectraKeras_MLP.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'''
**********************************************
* SpectraKeras_MLP Classifier and Regressor
* v2024.10.07.3
* v2024.10.08.1
* Uses: TensorFlow
* By: Nicola Ferralis <[email protected]>
**********************************************
Expand Down Expand Up @@ -304,10 +304,11 @@ def get_model():
amsgrad=False)

model = keras.models.Sequential()
model.add(keras.Input(shape=(A.shape[1],)))
for i in range(len(dP.HL)):
model.add(keras.layers.Dense(dP.HL[i],
activation = 'relu',
input_dim=A.shape[1],
#input_dim=A.shape[1],
kernel_regularizer=keras.regularizers.l2(dP.l2)))
model.add(keras.layers.Dropout(dP.drop))

Expand Down

0 comments on commit 7458220

Please sign in to comment.