MCPcopy Create free account
hub / github.com/apple/coremltools / testMiniBatchSizeOutOfAllowedSet

Function testMiniBatchSizeOutOfAllowedSet

mlmodel/tests/ParameterTests.cpp:289–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289int testMiniBatchSizeOutOfAllowedSet() {
290
291 Specification::Model m;
292
293 // basic neural network model without any updatable model parameters.
294 auto nn = buildBasicUpdatableNeuralNetworkModel(m);
295
296 std::set<int64_t> allowedValues = std::set<int64_t>();
297 allowedValues.insert(10);
298 allowedValues.insert(20);
299 allowedValues.insert(30);
300 allowedValues.insert(40);
301
302 addLearningRate(nn, Specification::Optimizer::kSgdOptimizer, 0.7f, 0.0f, 1.0f);
303 addMiniBatchSize(nn, Specification::Optimizer::kSgdOptimizer, 5, 10, 100, allowedValues);
304
305 // expect validation to fail due to conflict in updatable model parameter names.
306 Result res = Model::validate(m);
307 ML_ASSERT_BAD(res);
308 return 0;
309}
310
311int testLearningRateOutOfAllowedRange() {
312

Callers

nothing calls this directly

Calls 5

addLearningRateFunction · 0.85
addMiniBatchSizeFunction · 0.85
validateFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected