-
-
Save anonymous/eef4e163441fd98e78c901df79287092 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build and compile model | |
# length (in chars) of a label (this is a fixed value) | |
n = 7 | |
# total number (in chars) in label "alphabet": (0,1,2,3,4,5,6,7,8,9) | |
k = len("0123456789") | |
model = models.Sequential() | |
model.add(layers.Dense(x, activation='relu', input_shape=((N,)))) | |
... | |
model.add(layers.Dense(n * k, activation=None)) | |
model.add(layers.Reshape((n, k))) | |
model.add(layers.Dense(n, activation='softmax')) | |
model.compile(optimizer='rmsprop', | |
loss='categorical_crossentropy', | |
metrics=['accuracy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment