From 58d72f71c82fafc2756e0ea0720e729c130604c2 Mon Sep 17 00:00:00 2001 From: Karolina Oparczyk Date: Mon, 17 May 2021 18:48:14 +0200 Subject: [PATCH] decrease layers --- neural_network.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/neural_network.py b/neural_network.py index ec58259..99f3ac5 100644 --- a/neural_network.py +++ b/neural_network.py @@ -19,17 +19,14 @@ y = NormalizeData(y) model = keras.Sequential([ - keras.layers.Dense(512,input_dim = X.shape[1],kernel_initializer='normal', activation='relu'), - keras.layers.Dense(512,kernel_initializer='normal', activation='relu'), - keras.layers.Dense(256,kernel_initializer='normal', activation='relu'), - keras.layers.Dense(256,kernel_initializer='normal', activation='relu'), - keras.layers.Dense(128,kernel_initializer='normal', activation='relu'), - keras.layers.Dense(1,kernel_initializer='normal', activation='linear'), + keras.layers.Dense(32,input_dim = X.shape[1],kernel_initializer='normal', activation='relu'), + keras.layers.Dense(64,kernel_initializer='normal', activation='relu'), + keras.layers.Dense(1,kernel_initializer='normal', activation='relu'), ]) model.compile(loss='mean_absolute_error', optimizer='adam', metrics=['mean_absolute_error']) -model.fit(X, y, epochs=30, validation_split = 0.3) +model.fit(X, y, epochs=15, validation_split = 0.3) data = pd.read_csv("data_test", sep=',', error_bad_lines=False).dropna() X_test = data.loc[:,data.columns == "2805317"].astype(int)