Created
June 9, 2022 12:34
-
-
Save zaleslaw/a994e3519f7a0996fde10fc26e1d4825 to your computer and use it in GitHub Desktop.
Trains noTop model
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
model.use { | |
it.compile( | |
optimizer = Adam(), | |
loss = Losses.SOFT_MAX_CROSS_ENTROPY_WITH_LOGITS, | |
metric = Metrics.ACCURACY | |
) | |
it.loadWeightsForFrozenLayers(hdfFile) | |
it.fit( | |
dataset = train, | |
batchSize = TRAINING_BATCH_SIZE, | |
epochs = EPOCHS | |
) | |
val accuracy = it.evaluate(dataset = test, batchSize = TEST_BATCH_SIZE).metrics[Metrics.ACCURACY] | |
println("Accuracy: $accuracy") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment