Created
May 28, 2022 03:24
-
-
Save esenthil2018/0f63bd469c6214dbad2bc043afb70d43 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#The below is the code generated by get_code() method. | |
import pickle | |
import lineapy | |
import tensorflow as tf | |
from lineapy.utils.utils import prettify | |
from tensorflow import keras | |
from tensorflow.keras import layers | |
normalizer = tf.keras.layers.Normalization(axis=-1) | |
train_features1 = pickle.load(open("/root/.lineapy/linea_pickles/yzU2NLl", "rb")) | |
train_labels1 = pickle.load(open("/root/.lineapy/linea_pickles/GPSupKi", "rb")) | |
def build_and_compile_model(norm): | |
model = keras.Sequential( | |
[ | |
norm, | |
layers.Dense(64, activation="relu"), | |
layers.Dense(64, activation="relu"), | |
layers.Dense(1), | |
] | |
) | |
model.compile(loss="mean_absolute_error", optimizer=tf.keras.optimizers.Adam(0.001)) | |
return model | |
dnn_model = build_and_compile_model(normalizer) | |
history = dnn_model.fit( | |
train_features1, train_labels1, validation_split=0.2, verbose=0, epochs=100 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment