mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
Some conv-lstm, sgdr and other fixes
This commit is contained in:
@ -1046,13 +1046,9 @@ void backward_convolutional_layer(convolutional_layer l, network_state state)
|
||||
}
|
||||
}
|
||||
|
||||
void update_convolutional_layer(convolutional_layer l, update_args a)
|
||||
void update_convolutional_layer(convolutional_layer l, int batch, float learning_rate, float momentum, float decay)
|
||||
{
|
||||
float learning_rate = a.learning_rate*l.learning_rate_scale;
|
||||
float momentum = a.momentum;
|
||||
float decay = a.decay;
|
||||
int batch = a.batch;
|
||||
|
||||
//int size = l.size*l.size*l.c*l.n;
|
||||
axpy_cpu(l.n, learning_rate / batch, l.bias_updates, 1, l.biases, 1);
|
||||
scal_cpu(l.n, momentum, l.bias_updates, 1);
|
||||
|
||||
@ -1067,6 +1063,7 @@ void update_convolutional_layer(convolutional_layer l, update_args a)
|
||||
}
|
||||
|
||||
|
||||
|
||||
image get_convolutional_weight(convolutional_layer l, int i)
|
||||
{
|
||||
int h = l.size;
|
||||
@ -1101,7 +1098,7 @@ void rescale_weights(convolutional_layer l, float scale, float trans)
|
||||
|
||||
image *get_weights(convolutional_layer l)
|
||||
{
|
||||
image *weights = calloc(l.n, sizeof(image));
|
||||
image *weights = (image *)calloc(l.n, sizeof(image));
|
||||
int i;
|
||||
for (i = 0; i < l.n; ++i) {
|
||||
weights[i] = copy_image(get_convolutional_weight(l, i));
|
||||
|
Reference in New Issue
Block a user