Skip to content

Instantly share code, notes, and snippets.

@zeakey
Last active September 24, 2017 03:01
Show Gist options
  • Save zeakey/7e0d9e49be0d4b0da9d98e132968807f to your computer and use it in GitHub Desktop.
Save zeakey/7e0d9e49be0d4b0da9d98e132968807f to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from __future__ import division\n",
"import numpy as np\n",
"import os, sys\n",
"from os.path import join\n",
"sys.path.insert(0, '../../python/')\n",
"sys.path.insert(0, 'lib')\n",
"import caffe\n",
"import matplotlib.pyplot as plt\n",
"from matplotlib import cm\n",
"%matplotlib inline\n",
"caffe.set_mode_gpu()\n",
"caffe.set_device(1)\n",
"solver = caffe.SGDSolver('solver.prototxt')\n",
"solver.net.copy_from('vgg16convs.caffemodel')\n",
"\n",
"def upsample_filt(size):\n",
" factor = (size + 1) // 2\n",
" if size % 2 == 1:\n",
" center = factor - 1\n",
" else:\n",
" center = factor - 0.5\n",
" og = np.ogrid[:size, :size]\n",
" return (1 - abs(og[0] - center) / factor) * \\\n",
" (1 - abs(og[1] - center) / factor)\n",
"\n",
"# set parameters s.t. deconvolutional layers compute bilinear interpolation\n",
"# N.B. this is for deconvolution without groups\n",
"def interp_surgery(net, layers):\n",
" for l in layers:\n",
" m, k, h, w = net.params[l][0].data.shape\n",
" if m != k:\n",
" print 'layer %s input(%d) + output(%d) channels need to be the same'%(l, m,k)\n",
" raise \n",
" if h != w:\n",
" print 'filters need to be square'\n",
" raise\n",
" filt = upsample_filt(h)\n",
" net.params[l][0].data[range(m), range(k), :, :] = filt\n",
"interp_layers = [k for k in solver.net.params.keys() if 'up' in k]\n",
"interp_surgery(solver.net, interp_layers)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initial parameters"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"conv1_1 weight mean= -0.00243791 std= 0.206699\n",
"conv1_1 bias mean= 0.501391 std= 0.32848\n",
"conv1_2 weight mean= 0.00491225 std= 0.042478\n",
"conv1_2 bias mean= 0.0585559 std= 0.334784\n",
"conv2_1 weight mean= 0.000198592 std= 0.0322231\n",
"conv2_1 bias mean= 0.110862 std= 0.122017\n",
"conv2_2 weight mean= -0.000280771 std= 0.0235406\n",
"conv2_2 bias mean= 0.0157631 std= 0.18893\n",
"conv3_1 weight mean= -0.000125897 std= 0.0173762\n",
"conv3_1 bias mean= 0.0171437 std= 0.070719\n",
"conv3_2 weight mean= -0.00023865 std= 0.0123452\n",
"conv3_2 bias mean= 0.0357958 std= 0.076249\n",
"conv3_3 weight mean= -0.000670671 std= 0.0126685\n",
"conv3_3 bias mean= 0.0261699 std= 0.0832692\n",
"conv4_1 weight mean= -0.000449347 std= 0.0100516\n",
"conv4_1 bias mean= 0.0204377 std= 0.0537191\n",
"conv4_2 weight mean= -0.000467314 std= 0.00762439\n",
"conv4_2 bias mean= 0.0298601 std= 0.0440915\n",
"conv4_3 weight mean= -0.000809169 std= 0.00795575\n",
"conv4_3 bias mean= 0.0319183 std= 0.0680846\n",
"conv5_1 weight mean= -0.000584893 std= 0.00869384\n",
"conv5_1 bias mean= 0.0457245 std= 0.131329\n",
"conv5_2 weight mean= -0.000740742 std= 0.00876056\n",
"conv5_2 bias mean= 0.0498643 std= 0.212884\n",
"conv5_3 weight mean= -0.00108189 std= 0.00847841\n",
"conv5_3 bias mean= 0.149864 std= 0.492821\n",
"score-dsn-2 weight mean= 0.0 std= 0.0\n",
"score-dsn-2 bias mean= 0.0 std= 0.0\n",
"upsample-2 weight mean= 0.125 std= 0.182217\n",
"upsample-2 bias mean= 0.0 std= 0.0\n",
"score-dsn-3 weight mean= 0.0 std= 0.0\n",
"score-dsn-3 bias mean= 0.0 std= 0.0\n",
"upsample-4 weight mean= 0.0833333 std= 0.17013\n",
"upsample-4 bias mean= 0.0 std= 0.0\n",
"score-dsn-4 weight mean= 0.0 std= 0.0\n",
"score-dsn-4 bias mean= 0.0 std= 0.0\n",
"upsample-8 weight mean= 0.0625 std= 0.153802\n",
"upsample-8 bias mean= 0.0 std= 0.0\n",
"score-dsn-5 weight mean= 0.0 std= 0.0\n",
"score-dsn-5 bias mean= 0.0 std= 0.0\n",
"upsample-16 weight mean= 0.05 std= 0.140281\n",
"upsample-16 bias mean= 0.0 std= 0.0\n",
"cat0-score weight mean= 0.25 std= 0.0\n",
"cat0-score bias mean= 0.0 std= 0.0\n",
"cat1-score weight mean= 0.25 std= 0.0\n",
"cat1-score bias mean= 0.0 std= 0.0\n",
"cat2-score weight mean= 0.333 std= 0.0\n",
"cat2-score bias mean= 0.0 std= 0.0\n",
"cat3-score weight mean= 0.5 std= 0.0\n",
"cat3-score bias mean= 0.0 std= 0.0\n",
"cat4-score weight mean= 1.0 std= 0.0\n",
"cat4-score bias mean= 0.0 std= 0.0\n"
]
}
],
"source": [
"for p in solver.net.params:\n",
" print p, 'weight mean=', solver.net.params[p][0].data.mean(), 'std=', solver.net.params[p][0].data.std()\n",
" if len(solver.net.params) > 1:\n",
" print p, 'bias mean=', solver.net.params[p][1].data.mean(), 'std=', solver.net.params[p][1].data.std()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1st step"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"solver.step(1)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"----------------------output-------------------------------\n",
"data data mean= -17.7456 std= 55.3427\n",
"label data mean= 0.0332219 std= 0.318866\n",
"data_data_0_split_0 data mean= -17.7456 std= 55.3427\n",
"data_data_0_split_1 data mean= -17.7456 std= 55.3427\n",
"data_data_0_split_2 data mean= -17.7456 std= 55.3427\n",
"data_data_0_split_3 data mean= -17.7456 std= 55.3427\n",
"data_data_0_split_4 data mean= -17.7456 std= 55.3427\n",
"label_data_1_split_0 data mean= 0.0332219 std= 0.318866\n",
"label_data_1_split_1 data mean= 0.0332219 std= 0.318866\n",
"label_data_1_split_2 data mean= 0.0332219 std= 0.318866\n",
"label_data_1_split_3 data mean= 0.0332219 std= 0.318866\n",
"label_data_1_split_4 data mean= 0.0332219 std= 0.318866\n",
"conv1_1 data mean= 8.60036 std= 25.6672\n",
"conv1_2 data mean= 45.5761 std= 104.337\n",
"pool1 data mean= 60.9306 std= 124.432\n",
"conv2_1 data mean= 78.943 std= 160.413\n",
"conv2_2 data mean= 88.2864 std= 245.731\n",
"conv2_2_relu2_2_0_split_0 data mean= 88.2864 std= 245.731\n",
"conv2_2_relu2_2_0_split_1 data mean= 88.2864 std= 245.731\n",
"pool2 data mean= 150.029 std= 329.905\n",
"conv3_1 data mean= 116.975 std= 284.611\n",
"conv3_2 data mean= 134.873 std= 289.403\n",
"conv3_3 data mean= 85.3694 std= 266.654\n",
"conv3_3_relu3_3_0_split_0 data mean= 85.3694 std= 266.654\n",
"conv3_3_relu3_3_0_split_1 data mean= 85.3694 std= 266.654\n",
"pool3 data mean= 152.712 std= 367.724\n",
"conv4_1 data mean= 86.7088 std= 211.117\n",
"conv4_2 data mean= 53.3881 std= 131.849\n",
"conv4_3 data mean= 12.1959 std= 55.0997\n",
"conv4_3_relu4_3_0_split_0 data mean= 12.1959 std= 55.0997\n",
"conv4_3_relu4_3_0_split_1 data mean= 12.1959 std= 55.0997\n",
"pool4 data mean= 23.5417 std= 79.1284\n",
"conv5_1 data mean= 13.1846 std= 37.4016\n",
"conv5_2 data mean= 5.2716 std= 16.2987\n",
"conv5_3 data mean= 0.864066 std= 4.67812\n",
"score-dsn2 data mean= 0.0 std= 0.0\n",
"score-dsn2-up data mean= 0.0 std= 0.0\n",
"upscore-dsn2 data mean= 0.0 std= 0.0\n",
"upscore-dsn2_crop_0_split_0 data mean= 0.0 std= 0.0\n",
"upscore-dsn2_crop_0_split_1 data mean= 0.0 std= 0.0\n",
"dsn2_loss data mean= 358.337 std= 0.0\n",
"score-dsn3 data mean= 0.0 std= 0.0\n",
"score-dsn3-up data mean= 0.0 std= 0.0\n",
"upscore-dsn3 data mean= 0.0 std= 0.0\n",
"upscore-dsn3_crop_0_split_0 data mean= 0.0 std= 0.0\n",
"upscore-dsn3_crop_0_split_1 data mean= 0.0 std= 0.0\n",
"dsn3_loss data mean= 719.402 std= 0.0\n",
"score-dsn4 data mean= 0.0 std= 0.0\n",
"score-dsn4-up data mean= 0.0 std= 0.0\n",
"upscore-dsn4 data mean= 0.0 std= 0.0\n",
"upscore-dsn4_crop_0_split_0 data mean= 0.0 std= 0.0\n",
"upscore-dsn4_crop_0_split_1 data mean= 0.0 std= 0.0\n",
"dsn4_loss data mean= 1139.84 std= 0.0\n",
"score-dsn5 data mean= 0.0 std= 0.0\n",
"score-dsn5-up data mean= 0.0 std= 0.0\n",
"upscore-dsn5 data mean= 0.0 std= 0.0\n",
"upscore-dsn5_crop_0_split_0 data mean= 0.0 std= 0.0\n",
"upscore-dsn5_crop_0_split_1 data mean= 0.0 std= 0.0\n",
"dsn5_loss data mean= 1948.57 std= 0.0\n",
"slice2-0 data mean= 0.0 std= 0.0\n",
"slice2-1 data mean= 0.0 std= 0.0\n",
"slice3-0 data mean= 0.0 std= 0.0\n",
"slice3-1 data mean= 0.0 std= 0.0\n",
"slice3-2 data mean= 0.0 std= 0.0\n",
"slice4-0 data mean= 0.0 std= 0.0\n",
"slice4-1 data mean= 0.0 std= 0.0\n",
"slice4-2 data mean= 0.0 std= 0.0\n",
"slice4-3 data mean= 0.0 std= 0.0\n",
"slice5-0 data mean= 0.0 std= 0.0\n",
"slice5-1 data mean= 0.0 std= 0.0\n",
"slice5-2 data mean= 0.0 std= 0.0\n",
"slice5-3 data mean= 0.0 std= 0.0\n",
"slice5-4 data mean= 0.0 std= 0.0\n",
"concat0 data mean= 0.0 std= 0.0\n",
"concat1 data mean= 0.0 std= 0.0\n",
"concat2 data mean= 0.0 std= 0.0\n",
"concat3 data mean= 0.0 std= 0.0\n",
"concat0-score data mean= 0.0 std= 0.0\n",
"concat1-score data mean= 0.0 std= 0.0\n",
"concat2-score data mean= 0.0 std= 0.0\n",
"concat3-score data mean= 0.0 std= 0.0\n",
"concat4-score data mean= 0.0 std= 0.0\n",
"concat-fuse data mean= 0.0 std= 0.0\n",
"fuse-loss data mean= 1948.57 std= 0.0\n",
"----------------------gradient-------------------------------\n",
"data diff mean= 0.0 std= 0.0\n",
"label diff mean= 0.0 std= 0.0\n",
"data_data_0_split_0 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_1 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_2 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_3 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_4 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_0 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_1 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_2 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_3 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_4 diff mean= 0.0 std= 0.0\n",
"conv1_1 diff mean= 0.0 std= 0.0\n",
"conv1_2 diff mean= 0.0 std= 0.0\n",
"pool1 diff mean= 0.0 std= 0.0\n",
"conv2_1 diff mean= 0.0 std= 0.0\n",
"conv2_2 diff mean= 0.0 std= 0.0\n",
"conv2_2_relu2_2_0_split_0 diff mean= 0.0 std= 0.0\n",
"conv2_2_relu2_2_0_split_1 diff mean= 0.0 std= 0.0\n",
"pool2 diff mean= 0.0 std= 0.0\n",
"conv3_1 diff mean= 0.0 std= 0.0\n",
"conv3_2 diff mean= 0.0 std= 0.0\n",
"conv3_3 diff mean= 0.0 std= 0.0\n",
"conv3_3_relu3_3_0_split_0 diff mean= 0.0 std= 0.0\n",
"conv3_3_relu3_3_0_split_1 diff mean= 0.0 std= 0.0\n",
"pool3 diff mean= 0.0 std= 0.0\n",
"conv4_1 diff mean= 0.0 std= 0.0\n",
"conv4_2 diff mean= 0.0 std= 0.0\n",
"conv4_3 diff mean= 0.0 std= 0.0\n",
"conv4_3_relu4_3_0_split_0 diff mean= 0.0 std= 0.0\n",
"conv4_3_relu4_3_0_split_1 diff mean= 0.0 std= 0.0\n",
"pool4 diff mean= 0.0 std= 0.0\n",
"conv5_1 diff mean= 0.0 std= 0.0\n",
"conv5_2 diff mean= 0.0 std= 0.0\n",
"conv5_3 diff mean= 0.0 std= 0.0\n",
"score-dsn2 diff mean= -0.00243886 std= 0.086988\n",
"score-dsn2-up diff mean= -0.000600985 std= 0.0362756\n",
"upscore-dsn2 diff mean= -0.00108017 std= 0.0486273\n",
"upscore-dsn2_crop_0_split_0 diff mean= -2.18352e-11 std= 0.0384626\n",
"upscore-dsn2_crop_0_split_1 diff mean= -0.00108017 std= 0.0120681\n",
"dsn2_loss diff mean= 1.0 std= 0.0\n",
"score-dsn3 diff mean= -0.00252976 std= 0.264299\n",
"score-dsn3-up diff mean= -0.000153631 std= 0.038629\n",
"upscore-dsn3 diff mean= -0.000280107 std= 0.0521595\n",
"upscore-dsn3_crop_0_split_0 diff mean= -1.01898e-10 std= 0.0408209\n",
"upscore-dsn3_crop_0_split_1 diff mean= -0.000280107 std= 0.0123627\n",
"dsn3_loss diff mean= 1.0 std= 0.0\n",
"score-dsn4 diff mean= 0.0087819 std= 0.765635\n",
"score-dsn4-up diff mean= 0.000129606 std= 0.0407347\n",
"upscore-dsn4 diff mean= 0.000243092 std= 0.0557874\n",
"upscore-dsn4_crop_0_split_0 diff mean= -2.94775e-10 std= 0.0420078\n",
"upscore-dsn4_crop_0_split_1 diff mean= 0.000243093 std= 0.0148399\n",
"dsn4_loss diff mean= 1.0 std= 0.0\n",
"score-dsn5 diff mean= 0.0552589 std= 2.7918\n",
"score-dsn5-up diff mean= 0.000193483 std= 0.0504554\n",
"upscore-dsn5 diff mean= 0.000404864 std= 0.0729855\n",
"upscore-dsn5_crop_0_split_0 diff mean= -1.83416e-10 std= 0.0470921\n",
"upscore-dsn5_crop_0_split_1 diff mean= 0.000404864 std= 0.0286083\n",
"dsn5_loss diff mean= 1.0 std= 0.0\n",
"slice2-0 diff mean= -0.00207907 std= 0.00613478\n",
"slice2-1 diff mean= -8.12663e-05 std= 0.0158634\n",
"slice3-0 diff mean= -0.00207907 std= 0.00613478\n",
"slice3-1 diff mean= -8.12663e-05 std= 0.0158634\n",
"slice3-2 diff mean= 0.00132001 std= 0.0127825\n",
"slice4-0 diff mean= -0.00207907 std= 0.00613478\n",
"slice4-1 diff mean= -8.12663e-05 std= 0.0158634\n",
"slice4-2 diff mean= 0.00132001 std= 0.0127825\n",
"slice4-3 diff mean= 0.00181269 std= 0.0204717\n",
"slice5-0 diff mean= -0.00207907 std= 0.00613478\n",
"slice5-1 diff mean= -8.12663e-05 std= 0.0158634\n",
"slice5-2 diff mean= 0.00132001 std= 0.0127825\n",
"slice5-3 diff mean= 0.00181269 std= 0.0204717\n",
"slice5-4 diff mean= 0.00105195 std= 0.0566635\n",
"concat0 diff mean= -0.00207907 std= 0.00613478\n",
"concat1 diff mean= -8.12663e-05 std= 0.0158634\n",
"concat2 diff mean= 0.00132001 std= 0.0127825\n",
"concat3 diff mean= 0.00181269 std= 0.0204717\n",
"concat0-score diff mean= -0.00831626 std= 0.0245391\n",
"concat1-score diff mean= -0.000325065 std= 0.0634535\n",
"concat2-score diff mean= 0.00396399 std= 0.038386\n",
"concat3-score diff mean= 0.00362538 std= 0.0409434\n",
"concat4-score diff mean= 0.00105195 std= 0.0566635\n",
"concat-fuse diff mean= -1.83416e-10 std= 0.0470921\n",
"fuse-loss diff mean= 1.0 std= 0.0\n",
"----------------------params-------------------------------\n",
"conv1_1 weight mean= -0.00243791 std= 0.206699\n",
"conv1_1 bias mean= 0.501391 std= 0.32848\n",
"conv1_2 weight mean= 0.00491225 std= 0.042478\n",
"conv1_2 bias mean= 0.0585559 std= 0.334784\n",
"conv2_1 weight mean= 0.000198592 std= 0.0322231\n",
"conv2_1 bias mean= 0.110862 std= 0.122017\n",
"conv2_2 weight mean= -0.000280771 std= 0.0235406\n",
"conv2_2 bias mean= 0.0157631 std= 0.18893\n",
"conv3_1 weight mean= -0.000125897 std= 0.0173762\n",
"conv3_1 bias mean= 0.0171437 std= 0.070719\n",
"conv3_2 weight mean= -0.00023865 std= 0.0123452\n",
"conv3_2 bias mean= 0.0357958 std= 0.076249\n",
"conv3_3 weight mean= -0.000670671 std= 0.0126685\n",
"conv3_3 bias mean= 0.0261699 std= 0.0832692\n",
"conv4_1 weight mean= -0.000449347 std= 0.0100516\n",
"conv4_1 bias mean= 0.0204377 std= 0.0537191\n",
"conv4_2 weight mean= -0.000467314 std= 0.00762439\n",
"conv4_2 bias mean= 0.0298601 std= 0.0440915\n",
"conv4_3 weight mean= -0.000809169 std= 0.00795575\n",
"conv4_3 bias mean= 0.0319183 std= 0.0680846\n",
"conv5_1 weight mean= -0.000584893 std= 0.00869384\n",
"conv5_1 bias mean= 0.0457245 std= 0.131329\n",
"conv5_2 weight mean= -0.000740742 std= 0.00876056\n",
"conv5_2 bias mean= 0.0498643 std= 0.212884\n",
"conv5_3 weight mean= -0.00108189 std= 0.00847841\n",
"conv5_3 bias mean= 0.149864 std= 0.492821\n",
"score-dsn-2 weight mean= 0.000101814 std= 0.000441367\n",
"score-dsn-2 bias mean= 9.43547e-07 std= 8.72559e-07\n",
"upsample-2 weight mean= 0.125 std= 0.182217\n",
"upsample-2 bias mean= 0.0 std= 0.0\n",
"score-dsn-3 weight mean= 2.4012e-05 std= 0.000400413\n",
"score-dsn-3 bias mean= 2.44678e-07 std= 3.34786e-06\n",
"upsample-4 weight mean= 0.0833333 std= 0.17013\n",
"upsample-4 bias mean= 0.0 std= 0.0\n",
"score-dsn-4 weight mean= -1.20919e-06 std= 7.15226e-05\n",
"score-dsn-4 bias mean= -2.12347e-07 std= 4.10156e-06\n",
"upsample-8 weight mean= 0.0625 std= 0.153802\n",
"upsample-8 bias mean= 0.0 std= 0.0\n",
"score-dsn-5 weight mean= 8.48931e-09 std= 9.08228e-06\n",
"score-dsn-5 bias mean= -3.53657e-07 std= 5.08338e-06\n",
"upsample-16 weight mean= 0.05 std= 0.140281\n",
"upsample-16 bias mean= 0.0 std= 0.0\n",
"cat0-score weight mean= 0.25 std= 0.0\n",
"cat0-score bias mean= 7.26442e-07 std= 0.0\n",
"cat1-score weight mean= 0.25 std= 0.0\n",
"cat1-score bias mean= 2.83952e-08 std= 0.0\n",
"cat2-score weight mean= 0.333 std= 0.0\n",
"cat2-score bias mean= -3.46263e-07 std= 0.0\n",
"cat3-score weight mean= 0.5 std= 0.0\n",
"cat3-score bias mean= -3.16684e-07 std= 0.0\n",
"cat4-score weight mean= 1.0 std= 0.0\n",
"cat4-score bias mean= -9.18897e-08 std= 0.0\n",
"----------------------param-diff-------------------------------\n",
"conv1_1 mean= -4.87582e-13 std= 4.13399e-11\n",
"conv1_2 mean= 9.82449e-13 std= 8.49559e-12\n",
"conv2_1 mean= 3.97183e-14 std= 6.44462e-12\n",
"conv2_2 mean= -5.61543e-14 std= 4.70812e-12\n",
"conv3_1 mean= -2.51794e-14 std= 3.47523e-12\n",
"conv3_2 mean= -4.773e-14 std= 2.46904e-12\n",
"conv3_3 mean= -1.34134e-13 std= 2.5337e-12\n",
"conv4_1 mean= -8.98694e-14 std= 2.01033e-12\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"conv4_2 mean= -9.34629e-14 std= 1.52488e-12\n",
"conv4_3 mean= -1.61834e-13 std= 1.59115e-12\n",
"conv5_1 mean= -1.16979e-11 std= 1.73877e-10\n",
"conv5_2 mean= -1.48148e-11 std= 1.75211e-10\n",
"conv5_3 mean= -2.16379e-11 std= 1.69568e-10\n",
"score-dsn-2 mean= -0.000101814 std= 0.000441367\n",
"upsample-2 mean= 0.0 std= 0.0\n",
"score-dsn-3 mean= -2.4012e-05 std= 0.000400413\n",
"upsample-4 mean= 0.0 std= 0.0\n",
"score-dsn-4 mean= 1.20919e-06 std= 7.15226e-05\n",
"upsample-8 mean= 0.0 std= 0.0\n",
"score-dsn-5 mean= -8.48931e-09 std= 9.08228e-06\n",
"upsample-16 mean= 0.0 std= 0.0\n",
"cat0-score mean= 2.5e-12 std= 0.0\n",
"cat1-score mean= 2.5e-12 std= 0.0\n",
"cat2-score mean= 6.66e-13 std= 0.0\n",
"cat3-score mean= 5e-12 std= 0.0\n",
"cat4-score mean= 1e-11 std= 0.0\n"
]
}
],
"source": [
"print '----------------------output-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'data mean=', solver.net.blobs[b].data.mean(), 'std=', solver.net.blobs[b].data.std()\n",
" \n",
"\n",
"print '----------------------gradient-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'diff mean=', solver.net.blobs[b].diff.mean(), 'std=', solver.net.blobs[b].diff.std()\n",
"\n",
"\n",
"print '----------------------params-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'weight mean=', solver.net.params[p][0].data.mean(), 'std=', solver.net.params[p][0].data.std()\n",
" if len(solver.net.params) > 1:\n",
" print p, 'bias mean=', solver.net.params[p][1].data.mean(), 'std=', solver.net.params[p][1].data.std()\n",
"\n",
" \n",
"print '----------------------param-diff-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'mean=', solver.net.params[p][0].diff.mean(), 'std=', solver.net.params[p][0].diff.std()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2nd step"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"solver.step(1)"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"----------------------output-------------------------------\n",
"data data mean= -60.5781 std= 47.7821\n",
"label data mean= 0.0744048 std= 0.438722\n",
"data_data_0_split_0 data mean= -60.5781 std= 47.7821\n",
"data_data_0_split_1 data mean= -60.5781 std= 47.7821\n",
"data_data_0_split_2 data mean= -60.5781 std= 47.7821\n",
"data_data_0_split_3 data mean= -60.5781 std= 47.7821\n",
"data_data_0_split_4 data mean= -60.5781 std= 47.7821\n",
"label_data_1_split_0 data mean= 0.0744048 std= 0.438722\n",
"label_data_1_split_1 data mean= 0.0744048 std= 0.438722\n",
"label_data_1_split_2 data mean= 0.0744048 std= 0.438722\n",
"label_data_1_split_3 data mean= 0.0744048 std= 0.438722\n",
"label_data_1_split_4 data mean= 0.0744048 std= 0.438722\n",
"conv1_1 data mean= 11.5286 std= 33.6745\n",
"conv1_2 data mean= 61.1319 std= 137.905\n",
"pool1 data mean= 77.9868 std= 156.583\n",
"conv2_1 data mean= 102.403 std= 200.71\n",
"conv2_2 data mean= 114.257 std= 320.312\n",
"conv2_2_relu2_2_0_split_0 data mean= 114.257 std= 320.312\n",
"conv2_2_relu2_2_0_split_1 data mean= 114.257 std= 320.312\n",
"pool2 data mean= 190.945 std= 425.021\n",
"conv3_1 data mean= 158.969 std= 381.43\n",
"conv3_2 data mean= 183.842 std= 393.794\n",
"conv3_3 data mean= 116.102 std= 354.756\n",
"conv3_3_relu3_3_0_split_0 data mean= 116.102 std= 354.756\n",
"conv3_3_relu3_3_0_split_1 data mean= 116.102 std= 354.756\n",
"pool3 data mean= 207.438 std= 486.361\n",
"conv4_1 data mean= 113.314 std= 273.443\n",
"conv4_2 data mean= 70.3311 std= 169.002\n",
"conv4_3 data mean= 15.9492 std= 70.664\n",
"conv4_3_relu4_3_0_split_0 data mean= 15.9492 std= 70.664\n",
"conv4_3_relu4_3_0_split_1 data mean= 15.9492 std= 70.664\n",
"pool4 data mean= 30.3596 std= 100.269\n",
"conv5_1 data mean= 16.962 std= 47.9016\n",
"conv5_2 data mean= 7.06578 std= 21.8466\n",
"conv5_3 data mean= 0.81309 std= 5.2585\n",
"score-dsn2 data mean= 1.69089 std= 6.12283\n",
"score-dsn2-up data mean= 1.66156 std= 5.92264\n",
"upscore-dsn2 data mean= 3.00979 std= 7.83611\n",
"upscore-dsn2_crop_0_split_0 data mean= 3.00979 std= 7.83611\n",
"upscore-dsn2_crop_0_split_1 data mean= 3.00979 std= 7.83611\n",
"dsn2_loss data mean= 3545.4 std= 0.0\n",
"score-dsn3 data mean= 0.693853 std= 10.481\n",
"score-dsn3-up data mean= 0.670094 std= 10.1237\n",
"upscore-dsn3 data mean= 1.0958 std= 13.5378\n",
"upscore-dsn3_crop_0_split_0 data mean= 1.0958 std= 13.5378\n",
"upscore-dsn3_crop_0_split_1 data mean= 1.0958 std= 13.5378\n",
"dsn3_loss data mean= 11223.5 std= 0.0\n",
"score-dsn4 data mean= -0.011856 std= 0.453913\n",
"score-dsn4-up data mean= -0.0110647 std= 0.426566\n",
"upscore-dsn4 data mean= -0.0149567 std= 0.574437\n",
"upscore-dsn4_crop_0_split_0 data mean= -0.0149567 std= 0.574437\n",
"upscore-dsn4_crop_0_split_1 data mean= -0.0149567 std= 0.574437\n",
"dsn4_loss data mean= 2128.56 std= 0.0\n",
"score-dsn5 data mean= -7.93547e-05 std= 0.00386097\n",
"score-dsn5-up data mean= -6.95928e-05 std= 0.00348032\n",
"upscore-dsn5 data mean= -8.00678e-05 std= 0.00537696\n",
"upscore-dsn5_crop_0_split_0 data mean= -8.00678e-05 std= 0.00537696\n",
"upscore-dsn5_crop_0_split_1 data mean= -8.00678e-05 std= 0.00537696\n",
"dsn5_loss data mean= 2743.47 std= 0.0\n",
"slice2-0 data mean= -2.80068 std= 3.72891\n",
"slice2-1 data mean= 8.82025 std= 6.43284\n",
"slice3-0 data mean= 8.37433 std= 4.56244\n",
"slice3-1 data mean= 10.3564 std= 8.8465\n",
"slice3-2 data mean= -15.4433 std= 6.20183\n",
"slice4-0 data mean= 0.460215 std= 0.204776\n",
"slice4-1 data mean= 0.484547 std= 0.440523\n",
"slice4-2 data mean= -0.458288 std= 0.220101\n",
"slice4-3 data mean= -0.546302 std= 0.285153\n",
"slice5-0 data mean= 0.00690559 std= 0.00526569\n",
"slice5-1 data mean= -0.00100864 std= 0.00311551\n",
"slice5-2 data mean= -0.00384912 std= 0.00300578\n",
"slice5-3 data mean= -0.00363548 std= 0.00253131\n",
"slice5-4 data mean= 0.00118731 std= 0.00368346\n",
"concat0 data mean= 1.51019 std= 5.09472\n",
"concat1 data mean= 4.91504 std= 7.21962\n",
"concat2 data mean= -5.30182 std= 8.01851\n",
"concat3 data mean= -0.274969 std= 0.338055\n",
"concat0-score data mean= 1.51019 std= 1.70993\n",
"concat1-score data mean= 4.91504 std= 3.68208\n",
"concat2-score data mean= -5.29652 std= 2.11618\n",
"concat3-score data mean= -0.274969 std= 0.143001\n",
"concat4-score data mean= 0.00118722 std= 0.00368346\n",
"concat-fuse data mean= 0.170987 std= 3.88333\n",
"fuse-loss data mean= 8882.55 std= 0.0\n",
"----------------------gradient-------------------------------\n",
"data diff mean= 0.0 std= 0.0\n",
"label diff mean= 0.0 std= 0.0\n",
"data_data_0_split_0 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_1 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_2 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_3 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_4 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_0 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_1 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_2 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_3 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_4 diff mean= 0.0 std= 0.0\n",
"conv1_1 diff mean= 7.23053e-05 std= 0.00212146\n",
"conv1_2 diff mean= 1.41235e-05 std= 0.00110037\n",
"pool1 diff mean= 3.49179e-05 std= 0.00236713\n",
"conv2_1 diff mean= 2.1526e-05 std= 0.000595042\n",
"conv2_2 diff mean= 1.00124e-05 std= 0.00050016\n",
"conv2_2_relu2_2_0_split_0 diff mean= 2.68122e-07 std= 0.000575418\n",
"conv2_2_relu2_2_0_split_1 diff mean= 1.65842e-05 std= 5.76423e-05\n",
"pool2 diff mean= 1.07249e-06 std= 0.00115084\n",
"conv3_1 diff mean= 2.05766e-05 std= 0.000505109\n",
"conv3_2 diff mean= 1.18348e-05 std= 0.000445589\n",
"conv3_3 diff mean= 2.29717e-05 std= 0.00040896\n",
"conv3_3_relu3_3_0_split_0 diff mean= -5.99449e-07 std= 6.99353e-05\n",
"conv3_3_relu3_3_0_split_1 diff mean= 5.26069e-05 std= 0.000604088\n",
"pool3 diff mean= -2.3978e-06 std= 0.000139855\n",
"conv4_1 diff mean= 2.02405e-06 std= 9.24378e-05\n",
"conv4_2 diff mean= -3.87482e-07 std= 0.00014699\n",
"conv4_3 diff mean= 5.85837e-06 std= 0.00019168\n",
"conv4_3_relu4_3_0_split_0 diff mean= 5.45143e-08 std= 8.30588e-06\n",
"conv4_3_relu4_3_0_split_1 diff mean= 2.50031e-05 std= 0.000402254\n",
"pool4 diff mean= 2.03504e-07 std= 1.60469e-05\n",
"conv5_1 diff mean= -3.0339e-07 std= 1.56625e-05\n",
"conv5_2 diff mean= -6.39383e-08 std= 2.66511e-05\n",
"conv5_3 diff mean= -1.89864e-06 std= 4.65337e-05\n",
"score-dsn2 diff mean= 0.00465618 std= 0.0743387\n",
"score-dsn2-up diff mean= 0.00114385 std= 0.0217175\n",
"upscore-dsn2 diff mean= 0.0023756 std= 0.0312509\n",
"upscore-dsn2_crop_0_split_0 diff mean= 3.68613e-10 std= 0.0119284\n",
"upscore-dsn2_crop_0_split_1 diff mean= 0.0023756 std= 0.0253645\n",
"dsn2_loss diff mean= 1.0 std= 0.0\n",
"score-dsn3 diff mean= 0.00625187 std= 0.64222\n",
"score-dsn3-up diff mean= 0.000377363 std= 0.0671821\n",
"upscore-dsn3 diff mean= 0.000797432 std= 0.0976593\n",
"upscore-dsn3_crop_0_split_0 diff mean= 1.68768e-10 std= 0.0759173\n",
"upscore-dsn3_crop_0_split_1 diff mean= 0.000797433 std= 0.026228\n",
"dsn3_loss diff mean= 1.0 std= 0.0\n",
"score-dsn4 diff mean= -0.019729 std= 2.11131\n",
"score-dsn4-up diff mean= -0.000287691 std= 0.0746432\n",
"upscore-dsn4 diff mean= -0.000629113 std= 0.110379\n",
"upscore-dsn4_crop_0_split_0 diff mean= -3.31751e-10 std= 0.0794053\n",
"upscore-dsn4_crop_0_split_1 diff mean= -0.000629112 std= 0.0340663\n",
"dsn4_loss diff mean= 1.0 std= 0.0\n",
"score-dsn5 diff mean= -0.10817 std= 5.21045\n",
"score-dsn5-up diff mean= -0.00037056 std= 0.0659001\n",
"upscore-dsn5 diff mean= -0.000923994 std= 0.104059\n",
"upscore-dsn5_crop_0_split_0 diff mean= 4.42335e-10 std= 0.0726825\n",
"upscore-dsn5_crop_0_split_1 diff mean= -0.000923994 std= 0.0391864\n",
"dsn5_loss diff mean= 1.0 std= 0.0\n",
"slice2-0 diff mean= -0.00448339 std= 0.0166479\n",
"slice2-1 diff mean= 0.00923459 std= 0.0302568\n",
"slice3-0 diff mean= -0.00448339 std= 0.0166479\n",
"slice3-1 diff mean= 0.00923459 std= 0.0302568\n",
"slice3-2 diff mean= -0.00235891 std= 0.0276056\n",
"slice4-0 diff mean= -0.00448339 std= 0.0166479\n",
"slice4-1 diff mean= 0.00923459 std= 0.0302568\n",
"slice4-2 diff mean= -0.00235891 std= 0.0276056\n",
"slice4-3 diff mean= -0.00490875 std= 0.0505362\n",
"slice5-0 diff mean= -0.00448339 std= 0.0166479\n",
"slice5-1 diff mean= 0.00923459 std= 0.0302568\n",
"slice5-2 diff mean= -0.00235891 std= 0.0276056\n",
"slice5-3 diff mean= -0.00490875 std= 0.0505362\n",
"slice5-4 diff mean= -0.00210352 std= 0.0550826\n",
"concat0 diff mean= -0.00448339 std= 0.0166479\n",
"concat1 diff mean= 0.00923459 std= 0.0302568\n",
"concat2 diff mean= -0.00235891 std= 0.0276056\n",
"concat3 diff mean= -0.00490875 std= 0.0505362\n",
"concat0-score diff mean= -0.0179335 std= 0.0665915\n",
"concat1-score diff mean= 0.0369384 std= 0.121027\n",
"concat2-score diff mean= -0.00708381 std= 0.0828997\n",
"concat3-score diff mean= -0.0098175 std= 0.101072\n",
"concat4-score diff mean= -0.00210352 std= 0.0550826\n",
"concat-fuse diff mean= 5.8978e-10 std= 0.0905992\n",
"fuse-loss diff mean= 1.0 std= 0.0\n",
"----------------------params-------------------------------\n",
"conv1_1 weight mean= -0.00222625 std= 0.206637\n",
"conv1_1 bias mean= 0.501384 std= 0.328478\n",
"conv1_2 weight mean= 0.00489145 std= 0.0424658\n",
"conv1_2 bias mean= 0.0585544 std= 0.334783\n",
"conv2_1 weight mean= 0.000144752 std= 0.0322141\n",
"conv2_1 bias mean= 0.110861 std= 0.122017\n",
"conv2_2 weight mean= -0.000316153 std= 0.0235339\n",
"conv2_2 bias mean= 0.0157628 std= 0.18893\n",
"conv3_1 weight mean= -0.000153391 std= 0.0173731\n",
"conv3_1 bias mean= 0.0171436 std= 0.0707189\n",
"conv3_2 weight mean= -0.000250196 std= 0.012343\n",
"conv3_2 bias mean= 0.0357957 std= 0.076249\n",
"conv3_3 weight mean= -0.000693932 std= 0.0126652\n",
"conv3_3 bias mean= 0.0261698 std= 0.0832692\n",
"conv4_1 weight mean= -0.000449964 std= 0.0100516\n",
"conv4_1 bias mean= 0.0204377 std= 0.0537191\n",
"conv4_2 weight mean= -0.000467256 std= 0.00762436\n",
"conv4_2 bias mean= 0.0298601 std= 0.0440915\n",
"conv4_3 weight mean= -0.000809657 std= 0.00795567\n",
"conv4_3 bias mean= 0.0319183 std= 0.0680846\n",
"conv5_1 weight mean= -0.000584621 std= 0.00869389\n",
"conv5_1 bias mean= 0.0457245 std= 0.131329\n",
"conv5_2 weight mean= -0.000740703 std= 0.00876059\n",
"conv5_2 bias mean= 0.0498643 std= 0.212884\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"conv5_3 weight mean= -0.00108149 std= 0.00847849\n",
"conv5_3 bias mean= 0.149864 std= 0.492821\n",
"score-dsn-2 weight mean= 3.78079e-05 std= 0.00107459\n",
"score-dsn-2 bias mean= 5.63507e-07 std= 1.12358e-05\n",
"upsample-2 weight mean= 0.125 std= 0.182217\n",
"upsample-2 bias mean= 0.0 std= 0.0\n",
"score-dsn-3 weight mean= 3.92001e-06 std= 0.0010003\n",
"score-dsn-3 bias mean= 5.22653e-08 std= 9.74625e-06\n",
"upsample-4 weight mean= 0.0833333 std= 0.17013\n",
"upsample-4 bias mean= 0.0 std= 0.0\n",
"score-dsn-4 weight mean= 3.33703e-06 std= 0.000203712\n",
"score-dsn-4 bias mean= -7.79306e-08 std= 1.13231e-05\n",
"upsample-8 weight mean= 0.0625 std= 0.153802\n",
"upsample-8 bias mean= 0.0 std= 0.0\n",
"score-dsn-5 weight mean= 7.05873e-07 std= 2.48914e-05\n",
"score-dsn-5 bias mean= -1.93836e-07 std= 1.50885e-05\n",
"upsample-16 weight mean= 0.05 std= 0.140281\n",
"upsample-16 bias mean= 0.0 std= 0.0\n",
"cat0-score weight mean= 0.250006 std= 7.62038e-05\n",
"cat0-score bias mean= 2.30819e-06 std= 0.0\n",
"cat1-score weight mean= 0.249651 std= 0.000335047\n",
"cat1-score bias mean= -1.85739e-06 std= 0.0\n",
"cat2-score weight mean= 0.332987 std= 1.80971e-05\n",
"cat2-score bias mean= -2.91355e-07 std= 0.0\n",
"cat3-score weight mean= 0.499996 std= 4.11272e-06\n",
"cat3-score bias mean= -9.37039e-08 std= 0.0\n",
"cat4-score weight mean= 1.0 std= 0.0\n",
"cat4-score bias mean= -6.57458e-08 std= 0.0\n",
"----------------------param-diff-------------------------------\n",
"conv1_1 mean= -0.000211661 std= 0.00029757\n",
"conv1_2 mean= 2.07924e-05 std= 0.000156512\n",
"conv2_1 mean= 5.38395e-05 std= 0.000182328\n",
"conv2_2 mean= 3.53812e-05 std= 0.000149731\n",
"conv3_1 mean= 2.74938e-05 std= 0.000113345\n",
"conv3_2 mean= 1.15466e-05 std= 7.4817e-05\n",
"conv3_3 mean= 2.32616e-05 std= 6.23528e-05\n",
"conv4_1 mean= 6.17032e-07 std= 4.22629e-06\n",
"conv4_2 mean= -5.90003e-08 std= 3.36282e-06\n",
"conv4_3 mean= 4.87793e-07 std= 2.78906e-06\n",
"conv5_1 mean= -2.72023e-07 std= 6.16576e-06\n",
"conv5_2 mean= -3.90692e-08 std= 4.86479e-06\n",
"conv5_3 mean= -4.08366e-07 std= 3.76607e-06\n",
"score-dsn-2 mean= 6.4006e-05 std= 0.00106119\n",
"upsample-2 mean= 0.0 std= 0.0\n",
"score-dsn-3 mean= 2.0092e-05 std= 0.000978987\n",
"upsample-4 mean= 0.0 std= 0.0\n",
"score-dsn-4 mean= -4.54622e-06 std= 0.000182138\n",
"upsample-8 mean= 0.0 std= 0.0\n",
"score-dsn-5 mean= -6.97384e-07 std= 1.85223e-05\n",
"upsample-16 mean= 0.0 std= 0.0\n",
"cat0-score mean= -5.60331e-06 std= 7.62054e-05\n",
"cat1-score mean= 0.000349079 std= 0.000335046\n",
"cat2-score mean= 1.34943e-05 std= 1.80913e-05\n",
"cat3-score mean= 4.19812e-06 std= 4.12008e-06\n",
"cat4-score mean= -4.90865e-08 std= 0.0\n"
]
}
],
"source": [
"print '----------------------output-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'data mean=', solver.net.blobs[b].data.mean(), 'std=', solver.net.blobs[b].data.std()\n",
" \n",
"\n",
"print '----------------------gradient-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'diff mean=', solver.net.blobs[b].diff.mean(), 'std=', solver.net.blobs[b].diff.std()\n",
"\n",
"\n",
"print '----------------------params-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'weight mean=', solver.net.params[p][0].data.mean(), 'std=', solver.net.params[p][0].data.std()\n",
" if len(solver.net.params) > 1:\n",
" print p, 'bias mean=', solver.net.params[p][1].data.mean(), 'std=', solver.net.params[p][1].data.std()\n",
"\n",
" \n",
"print '----------------------param-diff-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'mean=', solver.net.params[p][0].diff.mean(), 'std=', solver.net.params[p][0].diff.std()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3rd step"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"solver.step(1)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"----------------------output-------------------------------\n",
"data data mean= -25.2325 std= 47.9276\n",
"label data mean= 0.0256975 std= 0.272534\n",
"data_data_0_split_0 data mean= -25.2325 std= 47.9276\n",
"data_data_0_split_1 data mean= -25.2325 std= 47.9276\n",
"data_data_0_split_2 data mean= -25.2325 std= 47.9276\n",
"data_data_0_split_3 data mean= -25.2325 std= 47.9276\n",
"data_data_0_split_4 data mean= -25.2325 std= 47.9276\n",
"label_data_1_split_0 data mean= 0.0256975 std= 0.272534\n",
"label_data_1_split_1 data mean= 0.0256975 std= 0.272534\n",
"label_data_1_split_2 data mean= 0.0256975 std= 0.272534\n",
"label_data_1_split_3 data mean= 0.0256975 std= 0.272534\n",
"label_data_1_split_4 data mean= 0.0256975 std= 0.272534\n",
"conv1_1 data mean= 16.9157 std= 36.7505\n",
"conv1_2 data mean= 86.1918 std= 147.572\n",
"pool1 data mean= 138.297 std= 188.786\n",
"conv2_1 data mean= 157.612 std= 260.968\n",
"conv2_2 data mean= 171.853 std= 373.704\n",
"conv2_2_relu2_2_0_split_0 data mean= 171.853 std= 373.704\n",
"conv2_2_relu2_2_0_split_1 data mean= 171.853 std= 373.704\n",
"pool2 data mean= 318.969 std= 508.283\n",
"conv3_1 data mean= 189.929 std= 402.591\n",
"conv3_2 data mean= 188.352 std= 381.217\n",
"conv3_3 data mean= 103.348 std= 315.18\n",
"conv3_3_relu3_3_0_split_0 data mean= 103.348 std= 315.18\n",
"conv3_3_relu3_3_0_split_1 data mean= 103.348 std= 315.18\n",
"pool3 data mean= 195.311 std= 438.236\n",
"conv4_1 data mean= 98.7408 std= 236.528\n",
"conv4_2 data mean= 50.3674 std= 130.639\n",
"conv4_3 data mean= 10.6858 std= 48.7762\n",
"conv4_3_relu4_3_0_split_0 data mean= 10.6858 std= 48.7762\n",
"conv4_3_relu4_3_0_split_1 data mean= 10.6858 std= 48.7762\n",
"pool4 data mean= 21.4346 std= 70.2618\n",
"conv5_1 data mean= 11.5815 std= 33.9736\n",
"conv5_2 data mean= 4.389 std= 14.6146\n",
"conv5_3 data mean= 0.655857 std= 3.67502\n",
"score-dsn2 data mean= 1.34166 std= 18.2677\n",
"score-dsn2-up data mean= 1.33026 std= 17.9088\n",
"upscore-dsn2 data mean= 1.79187 std= 20.701\n",
"upscore-dsn2_crop_0_split_0 data mean= 1.79187 std= 20.701\n",
"upscore-dsn2_crop_0_split_1 data mean= 1.79187 std= 20.701\n",
"dsn2_loss data mean= 2563.7 std= 0.0\n",
"score-dsn3 data mean= -0.086471 std= 23.6833\n",
"score-dsn3-up data mean= -0.0850142 std= 23.277\n",
"upscore-dsn3 data mean= -0.120557 std= 26.546\n",
"upscore-dsn3_crop_0_split_0 data mean= -0.120557 std= 26.546\n",
"upscore-dsn3_crop_0_split_1 data mean= -0.120557 std= 26.546\n",
"dsn3_loss data mean= 27207.5 std= 0.0\n",
"score-dsn4 data mean= 0.0108242 std= 0.688274\n",
"score-dsn4-up data mean= 0.0104655 std= 0.658098\n",
"upscore-dsn4 data mean= 0.0156144 std= 0.723526\n",
"upscore-dsn4_crop_0_split_0 data mean= 0.0156144 std= 0.723526\n",
"upscore-dsn4_crop_0_split_1 data mean= 0.0156144 std= 0.723526\n",
"dsn4_loss data mean= 3163.98 std= 0.0\n",
"score-dsn5 data mean= 0.000121929 std= 0.00573909\n",
"score-dsn5-up data mean= 0.000114045 std= 0.00533985\n",
"upscore-dsn5 data mean= 0.000207208 std= 0.00618833\n",
"upscore-dsn5_crop_0_split_0 data mean= 0.000207208 std= 0.00618833\n",
"upscore-dsn5_crop_0_split_1 data mean= 0.000207208 std= 0.00618833\n",
"dsn5_loss data mean= 4877.22 std= 0.0\n",
"slice2-0 data mean= 21.1094 std= 7.18336\n",
"slice2-1 data mean= -17.5257 std= 7.68933\n",
"slice3-0 data mean= 30.0124 std= 11.0912\n",
"slice3-1 data mean= -29.7711 std= 13.457\n",
"slice3-2 data mean= -0.603008 std= 4.75208\n",
"slice4-0 data mean= 1.01607 std= 0.412055\n",
"slice4-1 data mean= -0.687778 std= 0.463798\n",
"slice4-2 data mean= -0.265756 std= 0.191684\n",
"slice4-3 data mean= -8.23608e-05 std= 0.311805\n",
"slice5-0 data mean= 0.00916279 std= 0.0059182\n",
"slice5-1 data mean= -0.00354905 std= 0.00497089\n",
"slice5-2 data mean= -0.00294073 std= 0.0023191\n",
"slice5-3 data mean= -0.000996972 std= 0.00247015\n",
"slice5-4 data mean= -0.000639998 std= 0.00372469\n",
"concat0 data mean= 13.0368 std= 14.5115\n",
"concat1 data mean= -11.997 std= 14.6514\n",
"concat2 data mean= -0.290568 std= 2.75681\n",
"concat3 data mean= -0.000539666 std= 0.220487\n",
"concat0-score data mean= 13.0381 std= 3.99512\n",
"concat1-score data mean= -11.9639 std= 4.58858\n",
"concat2-score data mean= -0.290254 std= 1.61015\n",
"concat3-score data mean= -0.00053976 std= 0.156193\n",
"concat4-score data mean= -0.000640064 std= 0.00372469\n",
"concat-fuse data mean= 0.156546 std= 8.39905\n",
"fuse-loss data mean= 23339.2 std= 0.0\n",
"----------------------gradient-------------------------------\n",
"data diff mean= 0.0 std= 0.0\n",
"label diff mean= 0.0 std= 0.0\n",
"data_data_0_split_0 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_1 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_2 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_3 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_4 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_0 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_1 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_2 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_3 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_4 diff mean= 0.0 std= 0.0\n",
"conv1_1 diff mean= 5.67065e-05 std= 0.00134611\n",
"conv1_2 diff mean= 9.63415e-06 std= 0.000727449\n",
"pool1 diff mean= 1.84192e-05 std= 0.00156511\n",
"conv2_1 diff mean= 1.05018e-05 std= 0.00040706\n",
"conv2_2 diff mean= 4.51609e-06 std= 0.000343263\n",
"conv2_2_relu2_2_0_split_0 diff mean= -2.07355e-06 std= 0.000391952\n",
"conv2_2_relu2_2_0_split_1 diff mean= 6.1839e-06 std= 0.00010301\n",
"pool2 diff mean= -8.25716e-06 std= 0.00078212\n",
"conv3_1 diff mean= 1.06017e-05 std= 0.000326383\n",
"conv3_2 diff mean= 7.06732e-06 std= 0.000316746\n",
"conv3_3 diff mean= 1.96189e-05 std= 0.000333196\n",
"conv3_3_relu3_3_0_split_0 diff mean= -2.17466e-07 std= 3.71149e-05\n",
"conv3_3_relu3_3_0_split_1 diff mean= 7.2668e-05 std= 0.000606691\n",
"pool3 diff mean= -8.62849e-07 std= 7.3926e-05\n",
"conv4_1 diff mean= 6.19026e-07 std= 4.7289e-05\n",
"conv4_2 diff mean= 9.49165e-08 std= 8.15432e-05\n",
"conv4_3 diff mean= 3.46404e-06 std= 0.00015839\n",
"conv4_3_relu4_3_0_split_0 diff mean= 1.27362e-08 std= 5.69021e-06\n",
"conv4_3_relu4_3_0_split_1 diff mean= 1.81088e-05 std= 0.000394947\n",
"pool4 diff mean= 5.0945e-08 std= 1.13803e-05\n",
"conv5_1 diff mean= -1.91496e-07 std= 1.13632e-05\n",
"conv5_2 diff mean= 2.06338e-09 std= 2.13216e-05\n",
"conv5_3 diff mean= -1.4625e-06 std= 4.57189e-05\n",
"score-dsn2 diff mean= 0.00333511 std= 0.0533529\n",
"score-dsn2-up diff mean= 0.000826694 std= 0.0241525\n",
"upscore-dsn2 diff mean= 0.00114728 std= 0.0284462\n",
"upscore-dsn2_crop_0_split_0 diff mean= -5.98024e-12 std= 0.0183954\n",
"upscore-dsn2_crop_0_split_1 diff mean= 0.00114728 std= 0.0174186\n",
"dsn2_loss diff mean= 1.0 std= 0.0\n",
"score-dsn3 diff mean= 0.00353378 std= 0.396242\n",
"score-dsn3-up diff mean= 0.000217142 std= 0.0600094\n",
"upscore-dsn3 diff mean= 0.000305269 std= 0.071152\n",
"upscore-dsn3_crop_0_split_0 diff mean= -1.11612e-10 std= 0.0546904\n",
"upscore-dsn3_crop_0_split_1 diff mean= 0.000305268 std= 0.0188468\n",
"dsn3_loss diff mean= 1.0 std= 0.0\n",
"score-dsn4 diff mean= -0.00860395 std= 0.98974\n",
"score-dsn4-up diff mean= -0.000129982 std= 0.0553765\n",
"upscore-dsn4 diff mean= -0.000187325 std= 0.0664786\n",
"upscore-dsn4_crop_0_split_0 diff mean= 5.83073e-11 std= 0.0459544\n",
"upscore-dsn4_crop_0_split_1 diff mean= -0.000187325 std= 0.021735\n",
"dsn4_loss diff mean= 1.0 std= 0.0\n",
"score-dsn5 diff mean= -0.0902456 std= 2.63354\n",
"score-dsn5-up diff mean= -0.000329729 std= 0.0515891\n",
"upscore-dsn5 diff mean= -0.000491206 std= 0.0629661\n",
"upscore-dsn5_crop_0_split_0 diff mean= -9.80759e-11 std= 0.0390461\n",
"upscore-dsn5_crop_0_split_1 diff mean= -0.000491206 std= 0.0267581\n",
"dsn5_loss diff mean= 1.0 std= 0.0\n",
"slice2-0 diff mean= 0.00237819 std= 0.0241481\n",
"slice2-1 diff mean= -8.36378e-05 std= 0.0045445\n",
"slice3-0 diff mean= 0.00238024 std= 0.0241689\n",
"slice3-1 diff mean= -8.3584e-05 std= 0.00454157\n",
"slice3-2 diff mean= -0.00138085 std= 0.0212966\n",
"slice4-0 diff mean= 0.00237924 std= 0.0241588\n",
"slice4-1 diff mean= -8.38257e-05 std= 0.00455471\n",
"slice4-2 diff mean= -0.00138101 std= 0.021299\n",
"slice4-3 diff mean= -0.00166371 std= 0.0286599\n",
"slice5-0 diff mean= 0.00237916 std= 0.0241579\n",
"slice5-1 diff mean= -8.38386e-05 std= 0.00455541\n",
"slice5-2 diff mean= -0.00138101 std= 0.0212991\n",
"slice5-3 diff mean= -0.00166374 std= 0.0286604\n",
"slice5-4 diff mean= -0.0017066 std= 0.0410915\n",
"concat0 diff mean= 0.00237921 std= 0.0241584\n",
"concat1 diff mean= -8.37215e-05 std= 0.00454905\n",
"concat2 diff mean= -0.00138096 std= 0.0212982\n",
"concat3 diff mean= -0.00166373 std= 0.0286601\n",
"concat0-score diff mean= 0.00951661 std= 0.0966316\n",
"concat1-score diff mean= -0.000335354 std= 0.0182216\n",
"concat2-score diff mean= -0.00414718 std= 0.0639612\n",
"concat3-score diff mean= -0.00332748 std= 0.0573208\n",
"concat4-score diff mean= -0.0017066 std= 0.0410915\n",
"concat-fuse diff mean= 9.15242e-11 std= 0.0614114\n",
"fuse-loss diff mean= 1.0 std= 0.0\n",
"----------------------params-------------------------------\n",
"conv1_1 weight mean= -0.00201519 std= 0.206433\n",
"conv1_1 bias mean= 0.501352 std= 0.328467\n",
"conv1_2 weight mean= 0.00481928 std= 0.0424281\n",
"conv1_2 bias mean= 0.0585489 std= 0.334777\n",
"conv2_1 weight mean= -2.2997e-05 std= 0.0321879\n",
"conv2_1 bias mean= 0.110859 std= 0.122015\n",
"conv2_2 weight mean= -0.000417006 std= 0.023515\n",
"conv2_2 bias mean= 0.0157621 std= 0.188929\n",
"conv3_1 weight mean= -0.000242199 std= 0.0173646\n",
"conv3_1 bias mean= 0.0171432 std= 0.0707185\n",
"conv3_2 weight mean= -0.000287413 std= 0.0123363\n",
"conv3_2 bias mean= 0.0357954 std= 0.0762487\n",
"conv3_3 weight mean= -0.000789632 std= 0.0126533\n",
"conv3_3 bias mean= 0.0261691 std= 0.0832691\n",
"conv4_1 weight mean= -0.000450978 std= 0.0100514\n",
"conv4_1 bias mean= 0.0204377 std= 0.0537191\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"conv4_2 weight mean= -0.000467251 std= 0.00762429\n",
"conv4_2 bias mean= 0.0298601 std= 0.0440915\n",
"conv4_3 weight mean= -0.000810939 std= 0.00795547\n",
"conv4_3 bias mean= 0.0319183 std= 0.0680846\n",
"conv5_1 weight mean= -0.00058397 std= 0.00869399\n",
"conv5_1 bias mean= 0.0457246 std= 0.131329\n",
"conv5_2 weight mean= -0.000740647 std= 0.00876064\n",
"conv5_2 bias mean= 0.0498643 std= 0.212884\n",
"conv5_3 weight mean= -0.00108062 std= 0.00847865\n",
"conv5_3 bias mean= 0.149864 std= 0.492822\n",
"score-dsn-2 weight mean= -0.000486214 std= 0.00158815\n",
"score-dsn-2 bias mean= -3.43767e-06 std= 1.5559e-05\n",
"upsample-2 weight mean= 0.125 std= 0.182217\n",
"upsample-2 bias mean= 0.0 std= 0.0\n",
"score-dsn-3 weight mean= -9.65364e-05 std= 0.00233762\n",
"score-dsn-3 bias mean= -1.09453e-06 std= 1.41796e-05\n",
"upsample-4 weight mean= 0.0833333 std= 0.17013\n",
"upsample-4 bias mean= 0.0 std= 0.0\n",
"score-dsn-4 weight mean= 1.50115e-05 std= 0.000426175\n",
"score-dsn-4 bias mean= 6.40501e-07 std= 1.58704e-05\n",
"upsample-8 weight mean= 0.0625 std= 0.153802\n",
"upsample-8 bias mean= 0.0 std= 0.0\n",
"score-dsn-5 weight mean= 2.17156e-06 std= 4.46614e-05\n",
"score-dsn-5 bias mean= 1.51667e-06 std= 2.90422e-05\n",
"upsample-16 weight mean= 0.05 std= 0.140281\n",
"upsample-16 bias mean= 0.0 std= 0.0\n",
"cat0-score weight mean= 0.248815 std= 0.00117645\n",
"cat0-score bias mean= 6.96518e-07 std= 0.0\n",
"cat1-score weight mean= 0.249292 std= 0.000682115\n",
"cat1-score bias mean= -3.44763e-06 std= 0.0\n",
"cat2-score weight mean= 0.332988 std= 1.39033e-05\n",
"cat2-score bias mean= 1.08077e-06 std= 0.0\n",
"cat3-score weight mean= 0.499995 std= 4.72369e-06\n",
"cat3-score bias mean= 1.16825e-06 std= 0.0\n",
"cat4-score weight mean= 1.0 std= 0.0\n",
"cat4-score bias mean= 5.02089e-07 std= 0.0\n",
"----------------------param-diff-------------------------------\n",
"conv1_1 mean= -0.000211054 std= 0.000632543\n",
"conv1_2 mean= 7.21696e-05 std= 0.000341389\n",
"conv2_1 mean= 0.000167749 std= 0.000484684\n",
"conv2_2 mean= 0.000100853 std= 0.000381156\n",
"conv3_1 mean= 8.88079e-05 std= 0.000300484\n",
"conv3_2 mean= 3.72164e-05 std= 0.000189022\n",
"conv3_3 mean= 9.57001e-05 std= 0.000127408\n",
"conv4_1 mean= 1.01407e-06 std= 7.7109e-06\n",
"conv4_2 mean= -4.33996e-09 std= 6.42801e-06\n",
"conv4_3 mean= 1.28205e-06 std= 5.77535e-06\n",
"conv5_1 mean= -6.51165e-07 std= 9.72857e-06\n",
"conv5_2 mean= -5.60424e-08 std= 8.74125e-06\n",
"conv5_3 mean= -8.6778e-07 std= 6.74048e-06\n",
"score-dsn-2 mean= 0.000524022 std= 0.000610353\n",
"upsample-2 mean= 0.0 std= 0.0\n",
"score-dsn-3 mean= 0.000100456 std= 0.00198044\n",
"upsample-4 mean= 0.0 std= 0.0\n",
"score-dsn-4 mean= -1.16744e-05 std= 0.000293277\n",
"upsample-8 mean= 0.0 std= 0.0\n",
"score-dsn-5 mean= -1.46569e-06 std= 2.31702e-05\n",
"upsample-16 mean= 0.0 std= 0.0\n",
"cat0-score mean= 0.00119012 std= 0.00119617\n",
"cat1-score mean= 0.000358439 std= 0.000347182\n",
"cat2-score mean= -1.79439e-06 std= 4.37827e-06\n",
"cat3-score mean= 6.74122e-07 std= 6.21417e-07\n",
"cat4-score mean= -7.86108e-08 std= 0.0\n"
]
}
],
"source": [
"print '----------------------output-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'data mean=', solver.net.blobs[b].data.mean(), 'std=', solver.net.blobs[b].data.std()\n",
" \n",
"\n",
"print '----------------------gradient-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'diff mean=', solver.net.blobs[b].diff.mean(), 'std=', solver.net.blobs[b].diff.std()\n",
"\n",
"\n",
"print '----------------------params-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'weight mean=', solver.net.params[p][0].data.mean(), 'std=', solver.net.params[p][0].data.std()\n",
" if len(solver.net.params) > 1:\n",
" print p, 'bias mean=', solver.net.params[p][1].data.mean(), 'std=', solver.net.params[p][1].data.std()\n",
"\n",
" \n",
"print '----------------------param-diff-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'mean=', solver.net.params[p][0].diff.mean(), 'std=', solver.net.params[p][0].diff.std()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4th step"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"solver.step(1)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"----------------------output-------------------------------\n",
"data data mean= -41.6021 std= 69.4978\n",
"label data mean= 0.121445 std= 0.578889\n",
"data_data_0_split_0 data mean= -41.6021 std= 69.4978\n",
"data_data_0_split_1 data mean= -41.6021 std= 69.4978\n",
"data_data_0_split_2 data mean= -41.6021 std= 69.4978\n",
"data_data_0_split_3 data mean= -41.6021 std= 69.4978\n",
"data_data_0_split_4 data mean= -41.6021 std= 69.4978\n",
"label_data_1_split_0 data mean= 0.121445 std= 0.578889\n",
"label_data_1_split_1 data mean= 0.121445 std= 0.578889\n",
"label_data_1_split_2 data mean= 0.121445 std= 0.578889\n",
"label_data_1_split_3 data mean= 0.121445 std= 0.578889\n",
"label_data_1_split_4 data mean= 0.121445 std= 0.578889\n",
"conv1_1 data mean= 11.7038 std= 33.7781\n",
"conv1_2 data mean= 62.3054 std= 133.385\n",
"pool1 data mean= 80.9894 std= 155.92\n",
"conv2_1 data mean= 98.9516 std= 200.168\n",
"conv2_2 data mean= 99.7519 std= 285.677\n",
"conv2_2_relu2_2_0_split_0 data mean= 99.7519 std= 285.677\n",
"conv2_2_relu2_2_0_split_1 data mean= 99.7519 std= 285.677\n",
"pool2 data mean= 172.451 std= 388.91\n",
"conv3_1 data mean= 127.573 std= 333.641\n",
"conv3_2 data mean= 123.288 std= 303.843\n",
"conv3_3 data mean= 49.4205 std= 196.96\n",
"conv3_3_relu3_3_0_split_0 data mean= 49.4205 std= 196.96\n",
"conv3_3_relu3_3_0_split_1 data mean= 49.4205 std= 196.96\n",
"pool3 data mean= 88.3367 std= 272.051\n",
"conv4_1 data mean= 52.9612 std= 134.822\n",
"conv4_2 data mean= 27.1649 std= 72.2138\n",
"conv4_3 data mean= 6.18843 std= 26.695\n",
"conv4_3_relu4_3_0_split_0 data mean= 6.18843 std= 26.695\n",
"conv4_3_relu4_3_0_split_1 data mean= 6.18843 std= 26.695\n",
"pool4 data mean= 12.2487 std= 38.5867\n",
"conv5_1 data mean= 6.2386 std= 17.8035\n",
"conv5_2 data mean= 2.59292 std= 8.11712\n",
"conv5_3 data mean= 0.408641 std= 2.25681\n",
"score-dsn2 data mean= -7.06279 std= 20.4277\n",
"score-dsn2-up data mean= -6.94855 std= 20.0122\n",
"upscore-dsn2 data mean= -12.3414 std= 25.9467\n",
"upscore-dsn2_crop_0_split_0 data mean= -12.3414 std= 25.9467\n",
"upscore-dsn2_crop_0_split_1 data mean= -12.3414 std= 25.9467\n",
"dsn2_loss data mean= 31088.4 std= 0.0\n",
"score-dsn3 data mean= -2.34249 std= 27.6634\n",
"score-dsn3-up data mean= -2.26806 std= 26.8957\n",
"upscore-dsn3 data mean= -3.85263 std= 36.8763\n",
"upscore-dsn3_crop_0_split_0 data mean= -3.85263 std= 36.8763\n",
"upscore-dsn3_crop_0_split_1 data mean= -3.85263 std= 36.8763\n",
"dsn3_loss data mean= 92855.8 std= 0.0\n",
"score-dsn4 data mean= 0.0417306 std= 0.726375\n",
"score-dsn4-up data mean= 0.0391547 std= 0.679854\n",
"upscore-dsn4 data mean= 0.0695022 std= 0.896644\n",
"upscore-dsn4_crop_0_split_0 data mean= 0.0695022 std= 0.896644\n",
"upscore-dsn4_crop_0_split_1 data mean= 0.0695022 std= 0.896644\n",
"dsn4_loss data mean= 3832.46 std= 0.0\n",
"score-dsn5 data mean= 0.00043675 std= 0.00677816\n",
"score-dsn5-up data mean= 0.000385276 std= 0.00615036\n",
"upscore-dsn5 data mean= 0.000807516 std= 0.00849699\n",
"upscore-dsn5_crop_0_split_0 data mean= 0.000807516 std= 0.00849699\n",
"upscore-dsn5_crop_0_split_1 data mean= 0.000807516 std= 0.00849699\n",
"dsn5_loss data mean= 5001.69 std= 0.0\n",
"slice2-0 data mean= 11.0164 std= 8.39617\n",
"slice2-1 data mean= -35.6991 std= 13.5943\n",
"slice3-0 data mean= -17.9525 std= 12.1413\n",
"slice3-1 data mean= -36.9856 std= 12.4537\n",
"slice3-2 data mean= 43.3802 std= 15.7964\n",
"slice4-0 data mean= 0.386496 std= 0.356184\n",
"slice4-1 data mean= -1.2791 std= 0.432658\n",
"slice4-2 data mean= 0.424505 std= 0.317013\n",
"slice4-3 data mean= 0.746107 std= 0.546164\n",
"slice5-0 data mean= 0.0121504 std= 0.00652197\n",
"slice5-1 data mean= -0.00884432 std= 0.00688099\n",
"slice5-2 data mean= -0.00156732 std= 0.00149096\n",
"slice5-3 data mean= 0.00245507 std= 0.00526458\n",
"slice5-4 data mean= -0.000156291 std= 0.00317303\n",
"concat0 data mean= -1.63437 std= 12.7588\n",
"concat1 data mean= -18.4932 std= 20.1003\n",
"concat2 data mean= 14.6011 std= 22.3016\n",
"concat3 data mean= 0.374281 std= 0.536112\n",
"concat0-score data mean= -1.60771 std= 4.27353\n",
"concat1-score data mean= -18.3928 std= 5.56732\n",
"concat2-score data mean= 14.5851 std= 5.2674\n",
"concat3-score data mean= 0.374275 std= 0.274226\n",
"concat4-score data mean= -0.000155789 std= 0.00317303\n",
"concat-fuse data mean= -1.00825 std= 11.187\n",
"fuse-loss data mean= 50933.6 std= 0.0\n",
"----------------------gradient-------------------------------\n",
"data diff mean= 0.0 std= 0.0\n",
"label diff mean= 0.0 std= 0.0\n",
"data_data_0_split_0 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_1 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_2 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_3 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_4 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_0 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_1 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_2 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_3 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_4 diff mean= 0.0 std= 0.0\n",
"conv1_1 diff mean= 0.000731519 std= 0.0119661\n",
"conv1_2 diff mean= 8.63292e-05 std= 0.00556413\n",
"pool1 diff mean= -0.000117972 std= 0.0122704\n",
"conv2_1 diff mean= 0.00014565 std= 0.00319919\n",
"conv2_2 diff mean= 0.000108371 std= 0.00281907\n",
"conv2_2_relu2_2_0_split_0 diff mean= 8.58717e-06 std= 0.00347809\n",
"conv2_2_relu2_2_0_split_1 diff mean= 5.22036e-05 std= 0.000996674\n",
"pool2 diff mean= 3.40184e-05 std= 0.0069226\n",
"conv3_1 diff mean= 0.00011708 std= 0.00270896\n",
"conv3_2 diff mean= 6.53767e-05 std= 0.00244248\n",
"conv3_3 diff mean= 0.000309718 std= 0.00273817\n",
"conv3_3_relu3_3_0_split_0 diff mean= -3.72737e-06 std= 0.000222462\n",
"conv3_3_relu3_3_0_split_1 diff mean= 0.00141641 std= 0.00595787\n",
"pool3 diff mean= -1.47133e-05 std= 0.000441805\n",
"conv4_1 diff mean= 6.12498e-06 std= 0.000278198\n",
"conv4_2 diff mean= -3.1668e-06 std= 0.000488765\n",
"conv4_3 diff mean= 3.30186e-05 std= 0.000963551\n",
"conv4_3_relu4_3_0_split_0 diff mean= 1.03217e-06 std= 8.05395e-05\n",
"conv4_3_relu4_3_0_split_1 diff mean= 0.000272076 std= 0.00262004\n",
"pool4 diff mean= 4.1287e-06 std= 0.000161039\n",
"conv5_1 diff mean= -4.51095e-06 std= 0.000157535\n",
"conv5_2 diff mean= 3.34268e-06 std= 0.000272716\n",
"conv5_3 diff mean= -2.58271e-05 std= 0.000396427\n",
"score-dsn2 diff mean= -0.0162184 std= 0.312759\n",
"score-dsn2-up diff mean= -0.00398901 std= 0.0987336\n",
"upscore-dsn2 diff mean= -0.00788364 std= 0.138691\n",
"upscore-dsn2_crop_0_split_0 diff mean= -2.40039e-10 std= 0.123094\n",
"upscore-dsn2_crop_0_split_1 diff mean= -0.00788364 std= 0.0212278\n",
"dsn2_loss diff mean= 1.0 std= 0.0\n",
"score-dsn3 diff mean= 0.0342176 std= 1.06179\n",
"score-dsn3-up diff mean= 0.00207064 std= 0.0950698\n",
"upscore-dsn3 diff mean= 0.00419861 std= 0.135343\n",
"upscore-dsn3_crop_0_split_0 diff mean= -2.24036e-09 std= 0.101844\n",
"upscore-dsn3_crop_0_split_1 diff mean= 0.00419861 std= 0.0410027\n",
"dsn3_loss diff mean= 1.0 std= 0.0\n",
"score-dsn4 diff mean= 0.0548188 std= 2.60181\n",
"score-dsn4-up diff mean= 0.000803671 std= 0.0828835\n",
"upscore-dsn4 diff mean= 0.00170403 std= 0.120683\n",
"upscore-dsn4_crop_0_split_0 diff mean= 1.20019e-10 std= 0.0894912\n",
"upscore-dsn4_crop_0_split_1 diff mean= 0.00170403 std= 0.0440907\n",
"dsn4_loss diff mean= 1.0 std= 0.0\n",
"score-dsn5 diff mean= -0.0890448 std= 8.67992\n",
"score-dsn5-up diff mean= -0.000306838 std= 0.0905676\n",
"upscore-dsn5 diff mean= -0.000691986 std= 0.136008\n",
"upscore-dsn5_crop_0_split_0 diff mean= -6.96113e-10 std= 0.0885888\n",
"upscore-dsn5_crop_0_split_1 diff mean= -0.000691987 std= 0.0592047\n",
"dsn5_loss diff mean= 1.0 std= 0.0\n",
"slice2-0 diff mean= -0.012078 std= 0.0030401\n",
"slice2-1 diff mean= -0.00368926 std= 0.0292714\n",
"slice3-0 diff mean= -0.0120427 std= 0.0030312\n",
"slice3-1 diff mean= -0.0036839 std= 0.0292289\n",
"slice3-2 diff mean= 0.0283224 std= 0.0572038\n",
"slice4-0 diff mean= -0.0121704 std= 0.00306334\n",
"slice4-1 diff mean= -0.00370587 std= 0.0294032\n",
"slice4-2 diff mean= 0.0283247 std= 0.0572085\n",
"slice4-3 diff mean= -0.00563235 std= 0.0514291\n",
"slice5-0 diff mean= -0.0121739 std= 0.00306423\n",
"slice5-1 diff mean= -0.003707 std= 0.0294121\n",
"slice5-2 diff mean= 0.0283251 std= 0.0572092\n",
"slice5-3 diff mean= -0.00563246 std= 0.05143\n",
"slice5-4 diff mean= -0.0102716 std= 0.0981553\n",
"concat0 diff mean= -0.0121162 std= 0.00305029\n",
"concat1 diff mean= -0.00369651 std= 0.029329\n",
"concat2 diff mean= 0.0283241 std= 0.0572072\n",
"concat3 diff mean= -0.00563241 std= 0.0514295\n",
"concat0-score diff mean= -0.0486957 std= 0.0122569\n",
"concat1-score diff mean= -0.014828 std= 0.117648\n",
"concat2-score diff mean= 0.0850602 std= 0.171799\n",
"concat3-score diff mean= -0.0112649 std= 0.10286\n",
"concat4-score diff mean= -0.0102716 std= 0.0981553\n",
"concat-fuse diff mean= 5.27111e-10 std= 0.121474\n",
"fuse-loss diff mean= 1.0 std= 0.0\n",
"----------------------params-------------------------------\n",
"conv1_1 weight mean= 0.000435843 std= 0.205815\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"conv1_1 bias mean= 0.501233 std= 0.328407\n",
"conv1_2 weight mean= 0.00460113 std= 0.0423029\n",
"conv1_2 bias mean= 0.0585333 std= 0.334758\n",
"conv2_1 weight mean= -0.000536947 std= 0.0321115\n",
"conv2_1 bias mean= 0.110853 std= 0.122012\n",
"conv2_2 weight mean= -0.000835336 std= 0.0234793\n",
"conv2_2 bias mean= 0.0157581 std= 0.188925\n",
"conv3_1 weight mean= -0.000464001 std= 0.0173659\n",
"conv3_1 bias mean= 0.0171419 std= 0.0707179\n",
"conv3_2 weight mean= -0.000386568 std= 0.0123431\n",
"conv3_2 bias mean= 0.0357947 std= 0.0762483\n",
"conv3_3 weight mean= -0.0011178 std= 0.0126328\n",
"conv3_3 bias mean= 0.0261661 std= 0.0832684\n",
"conv4_1 weight mean= -0.000452549 std= 0.0100512\n",
"conv4_1 bias mean= 0.0204377 std= 0.0537191\n",
"conv4_2 weight mean= -0.000467025 std= 0.00762419\n",
"conv4_2 bias mean= 0.0298601 std= 0.0440914\n",
"conv4_3 weight mean= -0.00081328 std= 0.00795512\n",
"conv4_3 bias mean= 0.0319182 std= 0.0680846\n",
"conv5_1 weight mean= -0.000581908 std= 0.00869433\n",
"conv5_1 bias mean= 0.0457248 std= 0.13133\n",
"conv5_2 weight mean= -0.00074117 std= 0.0087608\n",
"conv5_2 bias mean= 0.0498642 std= 0.212886\n",
"conv5_3 weight mean= -0.00107738 std= 0.00847925\n",
"conv5_3 bias mean= 0.149866 std= 0.492825\n",
"score-dsn-2 weight mean= -0.000493724 std= 0.00179099\n",
"score-dsn-2 bias mean= -2.02727e-06 std= 1.23629e-05\n",
"upsample-2 weight mean= 0.125 std= 0.182217\n",
"upsample-2 bias mean= 0.0 std= 0.0\n",
"score-dsn-3 weight mean= -0.000273404 std= 0.00378\n",
"score-dsn-3 bias mean= -4.79563e-06 std= 1.23636e-05\n",
"upsample-4 weight mean= 0.0833333 std= 0.17013\n",
"upsample-4 bias mean= 0.0 std= 0.0\n",
"score-dsn-4 weight mean= 2.13666e-05 std= 0.000667243\n",
"score-dsn-4 bias mean= 2.03871e-07 std= 2.55234e-05\n",
"upsample-8 weight mean= 0.0625 std= 0.153802\n",
"upsample-8 bias mean= 0.0 std= 0.0\n",
"score-dsn-5 weight mean= 3.99489e-06 std= 6.76885e-05\n",
"score-dsn-5 bias mean= 3.496e-06 std= 5.4871e-05\n",
"upsample-16 weight mean= 0.05 std= 0.140281\n",
"upsample-16 bias mean= 0.0 std= 0.0\n",
"cat0-score weight mean= 0.247605 std= 0.00269863\n",
"cat0-score bias mean= 2.3415e-06 std= 0.0\n",
"cat1-score weight mean= 0.248391 std= 0.00155658\n",
"cat1-score bias mean= -3.93627e-06 std= 0.0\n",
"cat2-score weight mean= 0.332621 std= 0.000523307\n",
"cat2-score bias mean= -3.09142e-06 std= 0.0\n",
"cat3-score weight mean= 0.500003 std= 3.487e-06\n",
"cat3-score bias mean= 3.0201e-06 std= 0.0\n",
"cat4-score weight mean= 1.0 std= 0.0\n",
"cat4-score bias mean= 1.66609e-06 std= 0.0\n",
"----------------------param-diff-------------------------------\n",
"conv1_1 mean= -0.00245104 std= 0.00489987\n",
"conv1_2 mean= 0.000218157 std= 0.000868287\n",
"conv2_1 mean= 0.00051395 std= 0.00120277\n",
"conv2_2 mean= 0.00041833 std= 0.00133822\n",
"conv3_1 mean= 0.000221802 std= 0.0011578\n",
"conv3_2 mean= 9.91553e-05 std= 0.000918032\n",
"conv3_3 mean= 0.000328164 std= 0.000799775\n",
"conv4_1 mean= 1.57042e-06 std= 1.37637e-05\n",
"conv4_2 mean= -2.26601e-07 std= 1.22435e-05\n",
"conv4_3 mean= 2.34078e-06 std= 1.01993e-05\n",
"conv5_1 mean= -2.06213e-06 std= 2.93478e-05\n",
"conv5_2 mean= 5.22793e-07 std= 2.71549e-05\n",
"conv5_3 mean= -3.23658e-06 std= 2.12457e-05\n",
"score-dsn-2 mean= 7.5094e-06 std= 0.00110524\n",
"upsample-2 mean= 0.0 std= 0.0\n",
"score-dsn-3 mean= 0.000176867 std= 0.00229228\n",
"upsample-4 mean= 0.0 std= 0.0\n",
"score-dsn-4 mean= -6.35516e-06 std= 0.000265697\n",
"upsample-8 mean= 0.0 std= 0.0\n",
"score-dsn-5 mean= -1.82333e-06 std= 2.61318e-05\n",
"upsample-16 mean= 0.0 std= 0.0\n",
"cat0-score mean= 0.00121021 std= 0.00161503\n",
"cat1-score mean= 0.000901351 std= 0.000875852\n",
"cat2-score mean= 0.000366859 std= 0.000509472\n",
"cat3-score mean= -8.28683e-06 std= 8.20949e-06\n",
"cat4-score mean= -8.81175e-08 std= 0.0\n"
]
}
],
"source": [
"print '----------------------output-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'data mean=', solver.net.blobs[b].data.mean(), 'std=', solver.net.blobs[b].data.std()\n",
" \n",
"\n",
"print '----------------------gradient-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'diff mean=', solver.net.blobs[b].diff.mean(), 'std=', solver.net.blobs[b].diff.std()\n",
"\n",
"\n",
"print '----------------------params-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'weight mean=', solver.net.params[p][0].data.mean(), 'std=', solver.net.params[p][0].data.std()\n",
" if len(solver.net.params) > 1:\n",
" print p, 'bias mean=', solver.net.params[p][1].data.mean(), 'std=', solver.net.params[p][1].data.std()\n",
"\n",
" \n",
"print '----------------------param-diff-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'mean=', solver.net.params[p][0].diff.mean(), 'std=', solver.net.params[p][0].diff.std()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 5th step"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"solver.step(1)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"----------------------output-------------------------------\n",
"data data mean= -16.9641 std= 56.7023\n",
"label data mean= 0.0902484 std= 0.438551\n",
"data_data_0_split_0 data mean= -16.9641 std= 56.7023\n",
"data_data_0_split_1 data mean= -16.9641 std= 56.7023\n",
"data_data_0_split_2 data mean= -16.9641 std= 56.7023\n",
"data_data_0_split_3 data mean= -16.9641 std= 56.7023\n",
"data_data_0_split_4 data mean= -16.9641 std= 56.7023\n",
"label_data_1_split_0 data mean= 0.0902484 std= 0.438551\n",
"label_data_1_split_1 data mean= 0.0902484 std= 0.438551\n",
"label_data_1_split_2 data mean= 0.0902484 std= 0.438551\n",
"label_data_1_split_3 data mean= 0.0902484 std= 0.438551\n",
"label_data_1_split_4 data mean= 0.0902484 std= 0.438551\n",
"conv1_1 data mean= 10.0002 std= 28.7214\n",
"conv1_2 data mean= 49.9039 std= 121.8\n",
"pool1 data mean= 70.557 std= 150.694\n",
"conv2_1 data mean= 73.1145 std= 187.038\n",
"conv2_2 data mean= 76.6265 std= 245.68\n",
"conv2_2_relu2_2_0_split_0 data mean= 76.6265 std= 245.68\n",
"conv2_2_relu2_2_0_split_1 data mean= 76.6265 std= 245.68\n",
"pool2 data mean= 126.231 std= 331.163\n",
"conv3_1 data mean= 109.507 std= 313.209\n",
"conv3_2 data mean= 113.344 std= 403.318\n",
"conv3_3 data mean= 41.1515 std= 259.213\n",
"conv3_3_relu3_3_0_split_0 data mean= 41.1515 std= 259.213\n",
"conv3_3_relu3_3_0_split_1 data mean= 41.1515 std= 259.213\n",
"pool3 data mean= 52.1183 std= 293.594\n",
"conv4_1 data mean= 52.1353 std= 142.969\n",
"conv4_2 data mean= 17.6806 std= 57.6951\n",
"conv4_3 data mean= 3.38707 std= 17.1541\n",
"conv4_3_relu4_3_0_split_0 data mean= 3.38707 std= 17.1541\n",
"conv4_3_relu4_3_0_split_1 data mean= 3.38707 std= 17.1541\n",
"pool4 data mean= 4.8114 std= 20.258\n",
"conv5_1 data mean= 2.93774 std= 8.70262\n",
"conv5_2 data mean= 0.886087 std= 3.09286\n",
"conv5_3 data mean= 0.0975739 std= 0.631557\n",
"score-dsn2 data mean= -5.00441 std= 10.9671\n",
"score-dsn2-up data mean= -4.91034 std= 10.4222\n",
"upscore-dsn2 data mean= -9.84044 std= 13.6369\n",
"upscore-dsn2_crop_0_split_0 data mean= -9.84044 std= 13.6369\n",
"upscore-dsn2_crop_0_split_1 data mean= -9.84044 std= 13.6369\n",
"dsn2_loss data mean= 5056.2 std= 0.0\n",
"score-dsn3 data mean= -7.93877 std= 68.8131\n",
"score-dsn3-up data mean= -7.6465 std= 67.3452\n",
"upscore-dsn3 data mean= -15.089 std= 98.4698\n",
"upscore-dsn3_crop_0_split_0 data mean= -15.089 std= 98.4698\n",
"upscore-dsn3_crop_0_split_1 data mean= -15.089 std= 98.4698\n",
"dsn3_loss data mean= 39655.3 std= 0.0\n",
"score-dsn4 data mean= 0.00449472 std= 0.498652\n",
"score-dsn4-up data mean= 0.00417284 std= 0.46971\n",
"upscore-dsn4 data mean= -0.00433848 std= 0.571354\n",
"upscore-dsn4_crop_0_split_0 data mean= -0.00433848 std= 0.571354\n",
"upscore-dsn4_crop_0_split_1 data mean= -0.00433848 std= 0.571354\n",
"dsn4_loss data mean= 2526.59 std= 0.0\n",
"score-dsn5 data mean= 0.000135658 std= 0.00367465\n",
"score-dsn5-up data mean= 0.000117444 std= 0.00318097\n",
"upscore-dsn5 data mean= 9.78243e-05 std= 0.00328896\n",
"upscore-dsn5_crop_0_split_0 data mean= 9.78243e-05 std= 0.00328896\n",
"upscore-dsn5_crop_0_split_1 data mean= 9.78243e-05 std= 0.00328896\n",
"dsn5_loss data mean= 2951.92 std= 0.0\n",
"slice2-0 data mean= -17.9669 std= 12.6672\n",
"slice2-1 data mean= -1.71396 std= 8.91039\n",
"slice3-0 data mean= 54.6851 std= 18.8816\n",
"slice3-1 data mean= 45.5008 std= 17.921\n",
"slice3-2 data mean= -145.453 std= 53.637\n",
"slice4-0 data mean= 0.858642 std= 0.222574\n",
"slice4-1 data mean= -0.389488 std= 0.130363\n",
"slice4-2 data mean= -0.556081 std= 0.158544\n",
"slice4-3 data mean= 0.0695724 std= 0.105605\n",
"slice5-0 data mean= 0.0064627 std= 0.00151937\n",
"slice5-1 data mean= -0.00181986 std= 0.000559091\n",
"slice5-2 data mean= -0.00136011 std= 0.000467671\n",
"slice5-3 data mean= -0.00134348 std= 0.000436132\n",
"slice5-4 data mean= -0.00145012 std= 0.000517813\n",
"concat0 data mean= 9.39583 std= 29.4869\n",
"concat1 data mean= 10.8489 std= 22.3785\n",
"concat2 data mean= -48.6701 std= 75.1165\n",
"concat3 data mean= 0.0341145 std= 0.0826653\n",
"concat0-score data mean= 9.08331 std= 3.84945\n",
"concat1-score data mean= 10.6964 std= 5.14514\n",
"concat2-score data mean= -48.4587 std= 17.8385\n",
"concat3-score data mean= 0.034118 std= 0.0527723\n",
"concat4-score data mean= -0.00144845 std= 0.000517813\n",
"concat-fuse data mean= -5.72927 std= 23.4118\n",
"fuse-loss data mean= 40871.9 std= 0.0\n",
"----------------------gradient-------------------------------\n",
"data diff mean= 0.0 std= 0.0\n",
"label diff mean= 0.0 std= 0.0\n",
"data_data_0_split_0 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_1 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_2 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_3 diff mean= 0.0 std= 0.0\n",
"data_data_0_split_4 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_0 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_1 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_2 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_3 diff mean= 0.0 std= 0.0\n",
"label_data_1_split_4 diff mean= 0.0 std= 0.0\n",
"conv1_1 diff mean= 0.000462073 std= 0.00777928\n",
"conv1_2 diff mean= 3.73625e-05 std= 0.00422048\n",
"pool1 diff mean= 5.69905e-05 std= 0.00945017\n",
"conv2_1 diff mean= 0.000171267 std= 0.00260547\n",
"conv2_2 diff mean= 0.000121942 std= 0.0025887\n",
"conv2_2_relu2_2_0_split_0 diff mean= 9.58926e-05 std= 0.00368467\n",
"conv2_2_relu2_2_0_split_1 diff mean= -1.14914e-05 std= 0.000366638\n",
"pool2 diff mean= 0.000379212 std= 0.00732\n",
"conv3_1 diff mean= 0.000219894 std= 0.00270701\n",
"conv3_2 diff mean= 0.000112332 std= 0.00217152\n",
"conv3_3 diff mean= 7.34499e-05 std= 0.00319246\n",
"conv3_3_relu3_3_0_split_0 diff mean= 6.90773e-07 std= 0.000151255\n",
"conv3_3_relu3_3_0_split_1 diff mean= -0.00042832 std= 0.0086085\n",
"pool3 diff mean= 2.76309e-06 std= 0.0003025\n",
"conv4_1 diff mean= 1.72535e-07 std= 0.000174414\n",
"conv4_2 diff mean= 2.08167e-07 std= 0.000299842\n",
"conv4_3 diff mean= -2.31435e-06 std= 0.000811429\n",
"conv4_3_relu4_3_0_split_0 diff mean= 3.52463e-07 std= 2.37566e-05\n",
"conv4_3_relu4_3_0_split_1 diff mean= -0.000177056 std= 0.00372664\n",
"pool4 diff mean= 1.36839e-06 std= 4.67944e-05\n",
"conv5_1 diff mean= -1.4787e-06 std= 4.11644e-05\n",
"conv5_2 diff mean= 1.51492e-06 std= 8.09486e-05\n",
"conv5_3 diff mean= -1.50964e-05 std= 0.000257573\n",
"score-dsn2 diff mean= 0.00695975 std= 0.111188\n",
"score-dsn2-up diff mean= 0.00170723 std= 0.0387956\n",
"upscore-dsn2 diff mean= 0.00384703 std= 0.0581662\n",
"upscore-dsn2_crop_0_split_0 diff mean= 2.18038e-10 std= 0.03768\n",
"upscore-dsn2_crop_0_split_1 diff mean= 0.00384703 std= 0.032221\n",
"dsn2_loss diff mean= 1.0 std= 0.0\n",
"score-dsn3 diff mean= 0.00223417 std= 1.00639\n",
"score-dsn3-up diff mean= 0.000134495 std= 0.109592\n",
"upscore-dsn3 diff mean= 0.000312286 std= 0.166994\n",
"upscore-dsn3_crop_0_split_0 diff mean= -4.89629e-10 std= 0.14256\n",
"upscore-dsn3_crop_0_split_1 diff mean= 0.000312286 std= 0.0375772\n",
"dsn3_loss diff mean= 1.0 std= 0.0\n",
"score-dsn4 diff mean= -0.0313156 std= 2.3307\n",
"score-dsn4-up diff mean= -0.000454267 std= 0.0907057\n",
"upscore-dsn4 diff mean= -0.0010943 std= 0.140779\n",
"upscore-dsn4_crop_0_split_0 diff mean= -1.26232e-10 std= 0.108836\n",
"upscore-dsn4_crop_0_split_1 diff mean= -0.0010943 std= 0.0414188\n",
"dsn4_loss diff mean= 1.0 std= 0.0\n",
"score-dsn5 diff mean= -0.096769 std= 5.87835\n",
"score-dsn5-up diff mean= -0.000327253 std= 0.0703183\n",
"upscore-dsn5 diff mean= -0.000870995 std= 0.114717\n",
"upscore-dsn5_crop_0_split_0 diff mean= -5.87554e-10 std= 0.0841276\n",
"upscore-dsn5_crop_0_split_1 diff mean= -0.000870994 std= 0.0370554\n",
"dsn5_loss diff mean= 1.0 std= 0.0\n",
"slice2-0 diff mean= -0.0043595 std= 0.018622\n",
"slice2-1 diff mean= 0.0120536 std= 0.0399363\n",
"slice3-0 diff mean= -0.00429216 std= 0.0183343\n",
"slice3-1 diff mean= 0.0120233 std= 0.0398361\n",
"slice3-2 diff mean= -0.00679429 std= 0.0458718\n",
"slice4-0 diff mean= -0.00440722 std= 0.0188258\n",
"slice4-1 diff mean= 0.0121853 std= 0.0403729\n",
"slice4-2 diff mean= -0.00681684 std= 0.046024\n",
"slice4-3 diff mean= -0.00533845 std= 0.0502133\n",
"slice5-0 diff mean= -0.00440926 std= 0.0188345\n",
"slice5-1 diff mean= 0.012192 std= 0.0403951\n",
"slice5-2 diff mean= -0.00681719 std= 0.0460264\n",
"slice5-3 diff mean= -0.00533837 std= 0.0502126\n",
"slice5-4 diff mean= 1.78376e-05 std= 4.63799e-05\n",
"concat0 diff mean= -0.00436704 std= 0.0186553\n",
"concat1 diff mean= 0.0121135 std= 0.040136\n",
"concat2 diff mean= -0.00680944 std= 0.0459741\n",
"concat3 diff mean= -0.00533841 std= 0.050213\n",
"concat0-score diff mean= -0.0176371 std= 0.0753383\n",
"concat1-score diff mean= 0.048768 std= 0.16158\n",
"concat2-score diff mean= -0.020472 std= 0.138217\n",
"concat3-score diff mean= -0.0106767 std= 0.100425\n",
"concat4-score diff mean= 1.78376e-05 std= 4.63799e-05\n",
"concat-fuse diff mean= -1.54975e-10 std= 0.11331\n",
"fuse-loss diff mean= 1.0 std= 0.0\n",
"----------------------params-------------------------------\n",
"conv1_1 weight mean= 0.00235321 std= 0.204881\n",
"conv1_1 bias mean= 0.501084 std= 0.328335\n",
"conv1_2 weight mean= 0.00433961 std= 0.0421059\n",
"conv1_2 bias mean= 0.0585158 std= 0.334731\n",
"conv2_1 weight mean= -0.00138398 std= 0.0320091\n",
"conv2_1 bias mean= 0.110844 std= 0.122008\n",
"conv2_2 weight mean= -0.00148958 std= 0.0234545\n",
"conv2_2 bias mean= 0.0157517 std= 0.188925\n",
"conv3_1 weight mean= -0.000884821 std= 0.0174017\n",
"conv3_1 bias mean= 0.0171394 std= 0.0707178\n",
"conv3_2 weight mean= -0.000565784 std= 0.0123955\n",
"conv3_2 bias mean= 0.0357933 std= 0.0762483\n",
"conv3_3 weight mean= -0.00147277 std= 0.0126821\n",
"conv3_3 bias mean= 0.0261629 std= 0.0832679\n",
"conv4_1 weight mean= -0.000454035 std= 0.0100509\n",
"conv4_1 bias mean= 0.0204377 std= 0.0537191\n",
"conv4_2 weight mean= -0.000466825 std= 0.00762411\n",
"conv4_2 bias mean= 0.0298601 std= 0.0440914\n",
"conv4_3 weight mean= -0.000815426 std= 0.0079548\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"conv4_3 bias mean= 0.0319181 std= 0.0680846\n",
"conv5_1 weight mean= -0.00057993 std= 0.00869474\n",
"conv5_1 bias mean= 0.0457251 std= 0.131331\n",
"conv5_2 weight mean= -0.000741724 std= 0.008761\n",
"conv5_2 bias mean= 0.049864 std= 0.212888\n",
"conv5_3 weight mean= -0.00107425 std= 0.00847987\n",
"conv5_3 bias mean= 0.149868 std= 0.49283\n",
"score-dsn-2 weight mean= -0.000674058 std= 0.00218199\n",
"score-dsn-2 bias mean= -2.35642e-06 std= 1.674e-05\n",
"upsample-2 weight mean= 0.125 std= 0.182217\n",
"upsample-2 bias mean= 0.0 std= 0.0\n",
"score-dsn-3 weight mean= -0.000438969 std= 0.00524504\n",
"score-dsn-3 bias mean= -8.25637e-06 std= 1.70644e-05\n",
"upsample-4 weight mean= 0.0833333 std= 0.17013\n",
"upsample-4 bias mean= 0.0 std= 0.0\n",
"score-dsn-4 weight mean= 2.81749e-05 std= 0.000895351\n",
"score-dsn-4 bias mean= 2.65607e-07 std= 3.64206e-05\n",
"upsample-8 weight mean= 0.0625 std= 0.153802\n",
"upsample-8 bias mean= 0.0 std= 0.0\n",
"score-dsn-5 weight mean= 5.64943e-06 std= 9.01783e-05\n",
"score-dsn-5 bias mean= 5.63931e-06 std= 8.44668e-05\n",
"upsample-16 weight mean= 0.05 std= 0.140281\n",
"upsample-16 bias mean= 0.0 std= 0.0\n",
"cat0-score weight mean= 0.246629 std= 0.00376236\n",
"cat0-score bias mean= 4.55484e-06 std= 0.0\n",
"cat1-score weight mean= 0.246782 std= 0.00338694\n",
"cat1-score bias mean= -6.40245e-06 std= 0.0\n",
"cat2-score weight mean= 0.331995 std= 0.00139883\n",
"cat2-score bias mean= -5.99574e-06 std= 0.0\n",
"cat3-score weight mean= 0.500011 std= 1.09076e-05\n",
"cat3-score bias mean= 5.13041e-06 std= 0.0\n",
"cat4-score weight mean= 1.0 std= 0.0\n",
"cat4-score bias mean= 2.71295e-06 std= 0.0\n",
"----------------------param-diff-------------------------------\n",
"conv1_1 mean= -0.00191737 std= 0.00472554\n",
"conv1_2 mean= 0.000261516 std= 0.000991155\n",
"conv2_1 mean= 0.000847035 std= 0.00127976\n",
"conv2_2 mean= 0.000654245 std= 0.00123761\n",
"conv3_1 mean= 0.00042082 std= 0.00114624\n",
"conv3_2 mean= 0.000179215 std= 0.00100575\n",
"conv3_3 mean= 0.000354976 std= 0.0013518\n",
"conv4_1 mean= 1.48641e-06 std= 1.51653e-05\n",
"conv4_2 mean= -1.99151e-07 std= 1.30262e-05\n",
"conv4_3 mean= 2.14532e-06 std= 1.0479e-05\n",
"conv5_1 mean= -1.9772e-06 std= 2.76995e-05\n",
"conv5_2 mean= 5.53687e-07 std= 2.5712e-05\n",
"conv5_3 mean= -3.13157e-06 std= 2.07489e-05\n",
"score-dsn-2 mean= 0.000180334 std= 0.000829266\n",
"upsample-2 mean= 0.0 std= 0.0\n",
"score-dsn-3 mean= 0.000165565 std= 0.00219321\n",
"upsample-4 mean= 0.0 std= 0.0\n",
"score-dsn-4 mean= -6.80822e-06 std= 0.00024179\n",
"upsample-8 mean= 0.0 std= 0.0\n",
"score-dsn-5 mean= -1.65454e-06 std= 2.38796e-05\n",
"upsample-16 mean= 0.0 std= 0.0\n",
"cat0-score mean= 0.000976165 std= 0.00106632\n",
"cat1-score mean= 0.00160959 std= 0.00191707\n",
"cat2-score mean= 0.000626519 std= 0.000875533\n",
"cat3-score mean= -7.48072e-06 std= 7.42734e-06\n",
"cat4-score mean= -7.93152e-08 std= 0.0\n"
]
}
],
"source": [
"print '----------------------output-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'data mean=', solver.net.blobs[b].data.mean(), 'std=', solver.net.blobs[b].data.std()\n",
" \n",
"\n",
"print '----------------------gradient-------------------------------'\n",
"for b in solver.net.blobs:\n",
" print b, 'diff mean=', solver.net.blobs[b].diff.mean(), 'std=', solver.net.blobs[b].diff.std()\n",
"\n",
"\n",
"print '----------------------params-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'weight mean=', solver.net.params[p][0].data.mean(), 'std=', solver.net.params[p][0].data.std()\n",
" if len(solver.net.params) > 1:\n",
" print p, 'bias mean=', solver.net.params[p][1].data.mean(), 'std=', solver.net.params[p][1].data.std()\n",
"\n",
" \n",
"print '----------------------param-diff-------------------------------'\n",
"for p in solver.net.params:\n",
" print p, 'mean=', solver.net.params[p][0].diff.mean(), 'std=', solver.net.params[p][0].diff.std()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
net: "train_val.prototxt"
test_iter: 0
test_interval: 1000000
# lr for fine-tuning should be lower than when starting from scratch
#debug_info: true
base_lr: 1e-6
lr_policy: "step"
gamma: 0.1
iter_size: 1
# stepsize should also be lower, as we're closer to being done
stepsize: 5000
display: 10
max_iter: 15000
momentum: 0.9
weight_decay: 0.0002
snapshot: 1000
snapshot_prefix: "DS"
solver_mode: GPU
#solver_mode: CPU
name: "HED"
layer {
name: "data"
type: "ImageLabelmapData"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
mirror: false
mean_value: 104.00699
mean_value: 116.66877
mean_value: 122.67892
}
image_data_param {
root_folder: "../../data/SK-LARGE/"
source: "../../data/SK-LARGE/list_shuffled.txt"
batch_size: 1
shuffle: false
new_height: 0
new_width: 0
}
}
layer {
name: "data"
type: "ImageLabelmapData"
top: "data"
top: "label"
include {
phase: TEST
}
transform_param {
mirror: false
mean_value: 104.00699
mean_value: 116.66877
mean_value: 122.67892
}
image_data_param {
root_folder: "../../data/SK-LARGE/"
source: "../../data/SK-LARGE/list_shuffled.txt"
#Just setup the network. No real online testing
batch_size: 1
shuffle: false
new_height: 0
new_width: 0
}
}
layer {
bottom: 'data'
top: 'conv1_1'
name: 'conv1_1'
type: "Convolution"
param {
lr_mult: 1
decay_mult: 1
}
param {
lr_mult: 2
decay_mult: 0
}
convolution_param {
engine: CAFFE
num_output: 64
pad: 35
kernel_size: 3
}
}
layer {
bottom: 'conv1_1'
top: 'conv1_1'
name: 'relu1_1'
type: "ReLU"
}
layer { bottom: 'conv1_1' top: 'conv1_2' name: 'conv1_2' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 64 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv1_2' top: 'conv1_2' name: 'relu1_2' type: "ReLU" }
layer { name: 'pool1' bottom: 'conv1_2' top: 'pool1' type: "Pooling"
pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
layer { name: 'conv2_1' bottom: 'pool1' top: 'conv2_1' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv2_1' top: 'conv2_1' name: 'relu2_1' type: "ReLU" }
layer { bottom: 'conv2_1' top: 'conv2_2' name: 'conv2_2' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 128 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv2_2' top: 'conv2_2' name: 'relu2_2' type: "ReLU" }
layer { bottom: 'conv2_2' top: 'pool2' name: 'pool2' type: "Pooling"
pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
layer { bottom: 'pool2' top: 'conv3_1' name: 'conv3_1' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv3_1' top: 'conv3_1' name: 'relu3_1' type: "ReLU" }
layer { bottom: 'conv3_1' top: 'conv3_2' name: 'conv3_2' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv3_2' top: 'conv3_2' name: 'relu3_2' type: "ReLU" }
layer { bottom: 'conv3_2' top: 'conv3_3' name: 'conv3_3' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 256 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv3_3' top: 'conv3_3' name: 'relu3_3' type: "ReLU" }
layer { bottom: 'conv3_3' top: 'pool3' name: 'pool3' type: "Pooling"
pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
layer { bottom: 'pool3' top: 'conv4_1' name: 'conv4_1' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv4_1' top: 'conv4_1' name: 'relu4_1' type: "ReLU" }
layer { bottom: 'conv4_1' top: 'conv4_2' name: 'conv4_2' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv4_2' top: 'conv4_2' name: 'relu4_2' type: "ReLU" }
layer { bottom: 'conv4_2' top: 'conv4_3' name: 'conv4_3' type: "Convolution"
param { lr_mult: 1 decay_mult: 1 } param { lr_mult: 2 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv4_3' top: 'conv4_3' name: 'relu4_3' type: "ReLU" }
layer { bottom: 'conv4_3' top: 'pool4' name: 'pool4' type: "Pooling"
pooling_param { pool: MAX kernel_size: 2 stride: 2 } }
layer { bottom: 'pool4' top: 'conv5_1' name: 'conv5_1' type: "Convolution"
param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv5_1' top: 'conv5_1' name: 'relu5_1' type: "ReLU" }
layer { bottom: 'conv5_1' top: 'conv5_2' name: 'conv5_2' type: "Convolution"
param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv5_2' top: 'conv5_2' name: 'relu5_2' type: "ReLU" }
layer { bottom: 'conv5_2' top: 'conv5_3' name: 'conv5_3' type: "Convolution"
param { lr_mult: 100 decay_mult: 1 } param { lr_mult: 200 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 512 pad: 1 kernel_size: 3 } }
layer { bottom: 'conv5_3' top: 'conv5_3' name: 'relu5_3' type: "ReLU" }
## DSN conv 1 ###
#layer { name: 'score-dsn-1' type: "Convolution" bottom: 'conv1_2' top: 'score-dsn1-up'
# param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
# convolution_param { engine: CAFFE num_output: 2 kernel_size: 1}
#}
#layer { type: "Crop" name: 'crop' bottom: 'score-dsn1-up' bottom: 'data' top: 'upscore-dsn1' }
#layer {
# type: "SoftmaxWithLoss"
# name: "WeightedSoftmaxLoss1"
# bottom: "upscore-dsn1"
# bottom: "label"
# top:"dsn1_loss"
# loss_weight: 1
# loss_param {
# normalize: false
# }
#}
### DSN conv 2 ###
layer {
name: 'score-dsn-2' type: "Convolution" bottom: 'conv2_2' top: 'score-dsn2'
param { lr_mult: 0.01 decay_mult: 1 }
param { lr_mult: 0.02 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 2 kernel_size: 1
}
}
layer { type: "Deconvolution" name: 'upsample-2' bottom: 'score-dsn2' top: 'score-dsn2-up'
param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
convolution_param { kernel_size: 4 stride: 2 num_output: 2 }
}
layer { type: "Crop" name: 'crop' bottom: 'score-dsn2-up' bottom: 'data' top: 'upscore-dsn2' }
layer {
type: "SoftmaxWithLoss"
name: "loss2"
bottom: "upscore-dsn2"
bottom: "label"
top:"dsn2_loss"
loss_weight: 1
loss_param {
normalize: false
}
}
### DSN conv 3 ###
layer { name: 'score-dsn-3' type: "Convolution" bottom: 'conv3_3' top: 'score-dsn3'
param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 3 kernel_size: 1
}
}
layer { type: "Deconvolution" name: 'upsample-4' bottom: 'score-dsn3' top: 'score-dsn3-up'
param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
convolution_param { kernel_size: 8 stride: 4 num_output: 3 }
}
layer { type: "Crop" name: 'crop' bottom: 'score-dsn3-up' bottom: 'data' top: 'upscore-dsn3' }
layer {
type: "SoftmaxWithLoss"
name: "loss3"
bottom: "upscore-dsn3"
bottom: "label"
top:"dsn3_loss"
loss_weight: 1
loss_param {
normalize: false
}
}
###DSN conv 4###
layer { name: 'score-dsn-4' type: "Convolution" bottom: 'conv4_3' top: 'score-dsn4'
param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 4 kernel_size: 1 } }
layer { type: "Deconvolution" name: 'upsample-8' bottom: 'score-dsn4' top: 'score-dsn4-up'
param { lr_mult: 0 decay_mult: 1 } param { lr_mult: 0 decay_mult: 0}
convolution_param { kernel_size: 16 stride: 8 num_output: 4 } }
layer { type: "Crop" name: 'crop' bottom: 'score-dsn4-up' bottom: 'data' top: 'upscore-dsn4' }
layer {
type: "SoftmaxWithLoss"
name: "loss4"
bottom: "upscore-dsn4"
bottom: "label"
top:"dsn4_loss"
loss_weight: 1
loss_param {
normalize: false
}
}
###DSN conv 5###
layer { name: 'score-dsn-5' type: "Convolution" bottom: 'conv5_3' top: 'score-dsn5'
param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.02 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 5 kernel_size: 1 } }
layer {
type: "Deconvolution"
name: 'upsample-16'
bottom: 'score-dsn5'
top: 'score-dsn5-up'
param { lr_mult: 0 decay_mult: 1 }
param { lr_mult: 0 decay_mult: 0 }
convolution_param { kernel_size: 32 stride: 16 num_output: 5 } }
layer { type: "Crop" name: 'crop' bottom: 'score-dsn5-up' bottom: 'data' top: 'upscore-dsn5' }
layer {
type: "SoftmaxWithLoss"
name: "loss5"
bottom: "upscore-dsn5"
bottom: "label"
top:"dsn5_loss"
loss_weight: 1
loss_param {
normalize: false
}
}
### Concat and multiscale weight layer ###
#layer { name: "concat" bottom: "upscore-dsn1" bottom: "upscore-dsn2" bottom: "upscore-dsn3"
# bottom: "upscore-dsn4" bottom: "upscore-dsn5" top: "concat-upscore" type: "Concat"
# concat_param { concat_dim: 1} }
#layer { name: 'new-score-weighting' type: "Convolution" bottom: 'concat-upscore' top: 'upscore-fuse'
# param { lr_mult: 0.001 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
# convolution_param { engine: CAFFE num_output: 2 kernel_size: 1 weight_filler {type: "constant" value: 0.2} } }
#layer { type: "WeightedSoftmaxLoss" bottom: "upscore-fuse" bottom: "label" top:"fuse_loss" loss_weight: 1 }
## slice
layer{
type: "Slice" name: "slice2"
bottom: "upscore-dsn2"
top: "slice2-0"
top: "slice2-1"
slice_param {
axis: 1
slice_point: 1
}
}
layer{
type: "Slice" name: "slice3"
bottom: "upscore-dsn3"
top: "slice3-0"
top: "slice3-1"
top: "slice3-2"
slice_param {
axis: 1
slice_point: 1
slice_point: 2
}
}
layer{
type: "Slice" name: "slice4"
bottom: "upscore-dsn4"
top: "slice4-0"
top: "slice4-1"
top: "slice4-2"
top: "slice4-3"
slice_param {
axis: 1
slice_point: 1
slice_point: 2
slice_point: 3
}
}
layer{
type: "Slice" name: "slice5"
bottom: "upscore-dsn5"
top: "slice5-0"
top: "slice5-1"
top: "slice5-2"
top: "slice5-3"
top: "slice5-4"
slice_param {
axis: 1
slice_point: 1
slice_point: 2
slice_point: 3
slice_point: 4
}
}
## concat
layer {
name: "concat0" type: "Concat"
bottom: "slice2-0" bottom: "slice3-0" bottom: "slice4-0" bottom: "slice5-0"
top: "concat0"
concat_param { concat_dim: 1}
}
layer {
name: "concat1" type: "Concat"
bottom: "slice2-1" bottom: "slice3-1" bottom: "slice4-1" bottom: "slice5-1"
top: "concat1"
concat_param { concat_dim: 1}
}
layer {
name: "concat2" type: "Concat"
bottom: "slice3-2" bottom: "slice4-2" bottom: "slice5-2"
top: "concat2"
concat_param { concat_dim: 1}
}
layer {
name: "concat3" type: "Concat"
bottom: "slice4-3" bottom: "slice5-3"
top: "concat3"
concat_param { concat_dim: 1}
}
## score concated
layer {
name: 'cat0-score' type: "Convolution"
bottom: 'concat0' top: 'concat0-score'
param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
}
layer {
name: 'cat1-score' type: "Convolution"
bottom: 'concat1' top: 'concat1-score'
param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.25 } }
}
layer {
name: 'cat2-score' type: "Convolution"
bottom: 'concat2' top: 'concat2-score'
param { lr_mult: 0.01 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.333 } }
}
layer {
name: 'cat3-score' type: "Convolution"
bottom: 'concat3' top: 'concat3-score'
param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 0.5 } }
}
layer {
name: 'cat4-score' type: "Convolution"
bottom: 'slice5-4' top: 'concat4-score'
param { lr_mult: 0.05 decay_mult: 1 } param { lr_mult: 0.002 decay_mult: 0}
convolution_param { engine: CAFFE num_output: 1 kernel_size: 1 weight_filler {type: "constant" value: 1 } }
}
## concat
layer {
name: "concat-fuse" type: "Concat"
bottom: "concat0-score" bottom: "concat1-score" bottom: "concat2-score" bottom: "concat3-score" bottom: "concat4-score"
top: "concat-fuse"
concat_param { concat_dim: 1}
}
layer {
type: "SoftmaxWithLoss"
name: "loss-fuse"
bottom: "concat-fuse"
bottom: "label"
top:"fuse-loss"
loss_weight: 1
loss_param {
normalize: false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment