MCPcopy Create free account
hub / github.com/apache/singa / Checkpoint

Function Checkpoint

examples/cpp/imagenet/alexnet.cc:289–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void Checkpoint(FeedForwardNet &net, string prefix) {
290 Snapshot snapshot(prefix, Snapshot::kWrite, 200);
291 auto names = net.GetParamNames();
292 auto values = net.GetParamValues();
293 for (size_t k = 0; k < names.size(); k++) {
294 values.at(k).ToHost();
295 snapshot.Write(names.at(k), values.at(k));
296 }
297 LOG(INFO) << "Write snapshot into " << prefix;
298}
299
300void Train(int num_epoch, float lr, size_t batchsize, size_t train_file_size,
301 string bin_folder, size_t num_train_images, size_t num_test_images,

Callers 1

TrainFunction · 0.85

Calls 5

GetParamNamesMethod · 0.80
GetParamValuesMethod · 0.80
ToHostMethod · 0.80
sizeMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected