Change model architecture to a MLP

This commit is contained in:
coolneng 2021-07-06 01:44:58 +02:00
parent 1a1262b0b1
commit eabb7f0285
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 9 additions and 16 deletions

View File

@ -6,8 +6,8 @@ class Hyperparameters:
train_dataset="data/train_data.tfrecords", train_dataset="data/train_data.tfrecords",
test_dataset="data/test_data.tfrecords", test_dataset="data/test_data.tfrecords",
eval_dataset="data/eval_data.tfrecords", eval_dataset="data/eval_data.tfrecords",
epochs=1000, epochs=100,
batch_size=256, batch_size=64,
learning_rate=0.004, learning_rate=0.004,
l2_rate=0.001, l2_rate=0.001,
log_directory="logs", log_directory="logs",

View File

@ -17,23 +17,16 @@ def build_model(hyperparams) -> Model:
""" """
model = Sequential( model = Sequential(
[ [
Input(shape=(None, hyperparams.max_length, len(BASES))), Input(shape=(hyperparams.batch_size, hyperparams.max_length, len(BASES))),
Masking(mask_value=-1), Masking(mask_value=-1),
Conv1D( Dense(
filters=16, units=16, activation="relu", kernel_regularizer=l2(hyperparams.l2_rate)
kernel_size=5,
activation="relu",
kernel_regularizer=l2(hyperparams.l2_rate),
), ),
MaxPool1D(pool_size=3, strides=1), Dropout(rate=0.3),
Conv1D( Dense(
filters=16, units=16, activation="relu", kernel_regularizer=l2(hyperparams.l2_rate)
kernel_size=3,
activation="relu",
kernel_regularizer=l2(hyperparams.l2_rate),
), ),
MaxPool1D(pool_size=3, strides=1), Dropout(rate=0.3),
GlobalAveragePooling1D(),
Dense( Dense(
units=16, activation="relu", kernel_regularizer=l2(hyperparams.l2_rate) units=16, activation="relu", kernel_regularizer=l2(hyperparams.l2_rate)
), ),