1010#include " dsp.h"
1111#include " convnet.h"
1212
13- nam::convnet::BatchNorm::BatchNorm (const int dim, std::vector<float >::iterator & weights)
13+ nam::convnet::BatchNorm::BatchNorm (const int dim, std::vector<float >::const_iterator & weights)
1414{
1515 // Extract from param buffer
1616 Eigen::VectorXf running_mean (dim);
@@ -48,7 +48,7 @@ void nam::convnet::BatchNorm::process_(Eigen::MatrixXf& x, const long i_start, c
4848
4949void nam::convnet::ConvNetBlock::set_weights_ (const int in_channels, const int out_channels, const int _dilation,
5050 const bool batchnorm, const std::string activation,
51- std::vector<float >::iterator & weights)
51+ std::vector<float >::const_iterator & weights)
5252{
5353 this ->_batchnorm = batchnorm;
5454 // HACK 2 kernel
@@ -74,7 +74,7 @@ long nam::convnet::ConvNetBlock::get_out_channels() const
7474 return this ->conv .get_out_channels ();
7575}
7676
77- nam::convnet::_Head::_Head (const int channels, std::vector<float >::iterator & weights)
77+ nam::convnet::_Head::_Head (const int channels, std::vector<float >::const_iterator & weights)
7878{
7979 this ->_weight .resize (channels);
8080 for (int i = 0 ; i < channels; i++)
@@ -92,13 +92,13 @@ void nam::convnet::_Head::process_(const Eigen::MatrixXf& input, Eigen::VectorXf
9292}
9393
9494nam::convnet::ConvNet::ConvNet (const int channels, const std::vector<int >& dilations, const bool batchnorm,
95- const std::string activation, std::vector<float >& weights,
95+ const std::string activation, const std::vector<float >& weights,
9696 const double expected_sample_rate)
9797: Buffer(*std::max_element (dilations.begin(), dilations.end()), expected_sample_rate)
9898{
9999 this ->_verify_weights (channels, dilations, batchnorm, weights.size ());
100100 this ->_blocks .resize (dilations.size ());
101- std::vector<float >::iterator it = weights.begin ();
101+ std::vector<float >::const_iterator it = weights.begin ();
102102 for (size_t i = 0 ; i < dilations.size (); i++)
103103 this ->_blocks [i].set_weights_ (i == 0 ? 1 : channels, channels, dilations[i], batchnorm, activation, it);
104104 this ->_block_vals .resize (this ->_blocks .size () + 1 );
0 commit comments