Skip to content

Commit

Permalink
Added model name validation in SequentialCompilationTest.summary Kotl…
Browse files Browse the repository at this point in the history
  • Loading branch information
dosier committed Jun 15, 2021
1 parent fba4e3f commit 39f4f1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ internal fun GraphTrainableModel.serializeModel(isKerasFullyCompatible: Boolean)
(kerasLayers.first().config as LayerConfig).batch_input_shape =
listOf(null, inputShape[0], inputShape[1], inputShape[2]) // TODO: refactor with method for Input layer

val config = KerasModelConfig(name = "", layers = kerasLayers)
val config = KerasModelConfig(name = name, layers = kerasLayers)
return KerasModel(config = config)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ internal class SequentialModelTest {
biasInitializer = Constant(0.1f),
name = "dense_2"
)
)
).apply {
name = "sequential_model"
}

@Test
fun buildModel() {
Expand All @@ -99,6 +101,8 @@ internal class SequentialModelTest {
@Test
fun summary() {
correctTestModel.use {
assertEquals("sequential_model", it.name)

it.compile(optimizer = Adam(), loss = Losses.SOFT_MAX_CROSS_ENTROPY_WITH_LOGITS, metric = Accuracy())
val layerDescriptions = it.summary()
assertTrue(layerDescriptions[1].contentEquals("conv2d_1(Conv2D) [None, 28, 28, 32] 832"))
Expand Down

0 comments on commit 39f4f1f

Please sign in to comment.