layer_data_custom_smart_ptr layer::create_layer_data_custom() const { layer_data_custom_smart_ptr res(new layer_data_custom()); data_config dc = get_data_custom_config(); res->resize(dc.size()); for(unsigned int i = 0; i < dc.size(); ++i) (*res)[i].resize(dc[i], -1); return res; }
void layer::check_layer_data_custom_consistency(const layer_data_custom& data_custom) const { data_custom_config dcc = get_data_custom_config(); if (dcc.size() != data_custom.size()) throw neural_network_exception((boost::format("custom data weight vector count %1% doesn't satisfy layer configuration %2%") % data_custom.size() % dcc.size()).str()); for(unsigned int i = 0; i < dcc.size(); ++i) { if (dcc[i] != data_custom[i].size()) throw neural_network_exception((boost::format("custom data weight count %1% for vector %2% doesn't satisfy layer configuration %3%") % data_custom[i].size() % i % dcc[i]).str()); } }
bool layer::is_empty_data_custom() const { return get_data_custom_config().empty(); }