Categories
Misc

When you acess layers of the trained model by name, do you also get the weights?

Quick question, so, i’ve got some model (an autoencoder to be
exact) written in a sequential manner and let’s say it looks
something like this

input = keras.Input() conv = layers.Conv2D()(input) flatten = layers.Flatten()(conv) dense = layers.Dense()(flatten) out = layers.Dense()(dense) model = keras.Model(inputs=input, outputs=out) model.compile() 

and let’s say i’ve trained that model. If i then use some layers
of that model to make another one like this

new_model = keras.Model(inputs=input, outputs=conv) 

will that new model be already trained? I guess it poses more
global question, does keras.Model() create separate object which
uses those layers vairables you’ve written just to know the
structure, like a Class description or does it actually acts upon
those variables during actions like .fit()?

submitted by /u/Spectator696

[visit reddit]

[comments]

Leave a Reply

Your email address will not be published.