Windows 10 で Python 2.7 Anaconda を使用する
keras を使用して言語モデルを構築するために、GRU ニューラル ネットワークをトレーニングしました。
print('Build model...')
model = Sequential()
model.add(GRU(512, return_sequences=True, input_shape=(maxlen, len(chars))))
model.add(Dropout(0.2))
model.add(GRU(512, return_sequences=False))
model.add(Dropout(0.2))
model.add(Dense(len(chars)))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
この言語モデルの複雑さを計算するにはどうすればよいですか? たとえば、NLTK はそのモデルのパープレキシティ計算機能を提供します。