Change tensorflow import - Zadanie 6.2 training
This commit is contained in:
parent
bc74513edc
commit
73fbe01114
@ -1,8 +1,7 @@
|
||||
import tensorflow as tf
|
||||
import sys
|
||||
from tf.keras import layers
|
||||
from tensorflow.keras import layers
|
||||
# from keras.layers import Flatten,Dense,Dropout, GlobalAveragePooling2D
|
||||
from tf.keras.optimizers import Adam
|
||||
from tensorflow.keras.optimizers import Adam
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from sklearn.metrics import mean_squared_error
|
||||
@ -15,7 +14,7 @@ x_train.pop('Unnamed: 0')
|
||||
|
||||
learning_rate = 0.001 #sys.argv[1]
|
||||
|
||||
model = tf.keras.Sequential()
|
||||
model = tensorflow.keras.Sequential()
|
||||
model.add(layers.Input(shape=(22,)))
|
||||
model.add(layers.Dense(64))
|
||||
model.add(layers.Dense(64))
|
||||
@ -25,7 +24,7 @@ model.add(layers.Dense(1))
|
||||
model.compile(loss='mean_absolute_error', optimizer=Adam(learning_rate))
|
||||
|
||||
model.fit(
|
||||
x = tf.convert_to_tensor(x_train, np.float32),
|
||||
x = tensorflow.convert_to_tensor(x_train, np.float32),
|
||||
y = y_train,
|
||||
verbose=0, epochs=99)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user