-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define input_shape via Input call in Sequential model
This is only for MLP for now.
- Loading branch information
Showing
2 changed files
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
''' | ||
********************************************** | ||
* SpectraKeras_CNN Classifier and Regressor | ||
* v2024.10.07.2 | ||
* v2024.10.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
''' | ||
********************************************** | ||
* SpectraKeras_MLP Classifier and Regressor | ||
* v2024.10.07.3 | ||
* v2024.10.08.1 | ||
* Uses: TensorFlow | ||
* By: Nicola Ferralis <[email protected]> | ||
********************************************** | ||
|
@@ -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)) | ||
|
||
|