Given a model created using tf.sequential()
, is it possible to get the layers and to use them to create another model using tf.model()
?
const model = tf.sequential();
model.add(tf.layers.dense({units: 32, inputShape: [50]}));
model.add(tf.layers.dense({units: 4}));
// get the layers
layers
// use the layers to create another model
tf.model({layers})
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…