Skip to content

Input 2D matrices and Ouptut scalar #139

Answered by ashikshafi08
papipopapu asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @papipopapu

I think you may be looking for something like a Flatten layer, it will condense your outputs at the end.

#1
model_1 = tf.keras.Sequential([                                                            
    tf.keras.layers.Dense(100),
    tf.keras.layers.Dense(10),
   tf.keras.layers.Flatten(), # Add the flatten layer in here
    tf.keras.layers.Dense(1, activation = "relu")
])

#2
model_1.compile(optimizer = tf.optimizers.Adam(), loss = tf.keras.losses.mae )
#3
history = model_1.fit(X_train,y_train, epochs = 100, callbacks = [callback])

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@papipopapu
Comment options

Answer selected by papipopapu
Comment options

You must be logged in to vote
1 reply
@papipopapu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants