caffe-segnet
caffe-segnet copied to clipboard
the problem with compute_bn_statistics
Hi, Alex and guys:
I don't understand why compute the mean and var value in the for iterations and what does net.forward() do when no input data feed in. `
-- | net = caffe.Net(testable_net_path, train_weights_path, caffe.TEST) | # init our blob stores with the first forward pass | res = net.forward() | bn_avg_mean = {bn_mean: np.squeeze(res[bn_mean]).copy() for bn_mean in bn_means} | bn_avg_var = {bn_var: np.squeeze(res[bn_var]).copy() for bn_var in bn_vars} | | # iterate over the rest of the training set | for i in xrange(1, num_iterations): | res = net.forward() | for bn_mean in bn_means: | bn_avg_mean[bn_mean] += np.squeeze(res[bn_mean]) | for bn_var in bn_vars: | bn_avg_var[bn_var] += np.squeeze(res[bn_var]) | print 'progress: {}/{}'.format(i, num_iterations)
questions: 1.in every iteration ,there 's a
res = net.forward(), and followed by computing _res[bn_mean]_ and _res[bn_var]._ what does net.forward() actually do when there's no data feed in? 2.why _res[bn_mean]_ and _res[bn_var]_ computed after
res = net.forward()` and why in the for iteration?
thanks very much!
I also have the confusion. the goal of compute_bn_statistics.py is? when I test one image, why do not I fix the mean and the var gained in the training phase.