因為我是新手,請問Functional API model若要完成
輸入為xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0], dtype=float)
輸出為ys = np.array([-5.0, -2.0, 1.0, 4.0, 7.0, 10.0, 13.0], dtype=float)
進行輸入為7時的預測程式,請問程式要如何改寫?謝謝!!!
https://github.com/mc6666/Keras_tutorial/blob/master/06_01_Model.ipynb
from tensorflow.keras.layers import Dense
from tensorflow.keras.models import Model
InputTensor = tf.keras.Input(shape=(100,))
H1 = Dense(10, activation='relu')(InputTensor)
H2 = Dense(20, activation='relu')(H1)
Output = Dense(1, activation='softmax')(H2)
model_API = Model(inputs=InputTensor, outputs=Output)
model_API.summary()
from keras.utils import plot_model
tf.keras.utils.plot_model(model_API, to_file='Functional_API_model.png')