Skip to content

Commit ba7f9a8

Browse files
committed
add test case for fitting with validation data
1 parent e7805aa commit ba7f9a8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/testthat/test-model.R

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,22 @@ test_succeeds("can call a model with additional arguments", {
116116

117117
})
118118

119+
test_succeeds("pass validation_data to model fit", {
120+
121+
model <- keras_model_sequential() %>%
122+
layer_dense(units =1, input_shape = 2)
123+
124+
model %>% compile(loss = "mse", optimizer = "sgd")
125+
126+
model %>%
127+
fit(
128+
matrix(runif(100), ncol = 2), y = runif(50),
129+
batch_size = 10,
130+
validation_data = list(matrix(runif(100), ncol = 2), runif(50))
131+
)
132+
133+
})
134+
119135

120136

121137

0 commit comments

Comments
 (0)