num_observed(0), iteration(input_dims, label_dims), iq(iq) {}
IterationQueue::MarkableIteration::MarkableIteration(MarkableIteration &&rhs) :
- num_observed(rhs.num_observed),
- iteration(std::move(rhs.iteration)),
- iq(rhs.iq) {}
+ iteration(std::move(rhs.iteration)), iq(rhs.iq) {
+ std::lock_guard notify_lock_guard(notify_mutex);
+ num_observed = rhs.num_observed;
+}
void IterationQueue::MarkableIteration::reset() {
std::lock_guard notify_lock_guard(notify_mutex);
auto to_tensors = [](sharedConstTensors &sts) {
std::vector<Tensor> ts;
ts.reserve(sts.size());
- std::transform(sts.begin(), sts.end(), std::back_inserter(ts),
- [](const auto &ts) { return *ts; });
+ std::transform(
+ sts.begin(), sts.end(), std::back_inserter(ts),
+ [](const auto &ts) -> const auto & { return *ts; });
return ts;
};
}
GraphWatcher::GraphWatcher(const std::string &config, const bool opt) :
- nn(new nntrainer::NeuralNetwork()),
- expected_losses{},
- optimize(opt) {
+ nn(new nntrainer::NeuralNetwork()), expected_losses{}, optimize(opt) {
nn->loadFromConfig(config);
initialize();
}
GraphWatcher::GraphWatcher(std::unique_ptr<nntrainer::NeuralNetwork> &&net,
const bool opt) :
- nn(std::move(net)),
- optimize(opt) {
+ nn(std::move(net)), optimize(opt) {
initialize();
}