大家好,我有cnn + lstm keras模型,我想使用ctc损失函数,周围有很多解决方案,但是所有这些解决方案都很混乱,我们将不胜感激。 这是我的模特:
model=Sequential()
model.add(Conv2D(32, (3, 3), input_shape=(28, 28,3), activation='relu'))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(Conv2D(32, (3, 3), activation='relu'))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten())
model.add(Dense(32, activation='relu'))
model.add(RepeatVector(25))
model.add(LSTM(128, return_sequences=True, input_shape=(25,32), activation='relu'))
model.add(LSTM(256))
model.add(Dropout(0.25))
model.add(Dense(37))
model.compile(loss='ctc_loss', optimizer='rmsprop')