0

I want to perform feed forward propagation on CNN using Keras. I am trying to train CNN using my own optimizer, which I can't fit in the optimiser file of Keras. My optimiser in gradient free. I don't want any inbuilt to be used.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Bhaskar Dhariyal
  • 1,343
  • 2
  • 13
  • 31

1 Answers1

0

I found answer to this question. We just have to make model non trainable.

import numpy as np
import keras

x = keras.layers.Input(shape=(3,))
y = keras.layers.Dense(5)(x)

model = keras.models.Model(x, y)
model.trainable = False
model.compile(optimizer='rmsprop', loss='mse')

x = np.random.random((10, 3))
y = np.random.random((10, 5))
model.fit(x, y, epochs=10)
Bhaskar Dhariyal
  • 1,343
  • 2
  • 13
  • 31