I'm fine-tuning an existing network, adding one output layer of my own.
The network i'm using is already tuned to recognize faces and extract the facial features.
My added layer is only added to the last part (i'm hoping there is still enough data left there), trying to extract the yaw angle.
The end of the prototxt file before my changes:
layer {
name: "cls_prob"
type: "Softmax"
bottom: "fc6_3"
top: "cls_prob"
}
layer {
name: "bbox_reg_3"
type: "InnerProduct"
bottom: "fc5_3"
top: "bbox_reg_3"
inner_product_param {
num_output: 3
}
}
layer {
name: "rotate_reg_3"
type: "InnerProduct"
bottom: "fc5_3"
top: "rotate_reg_3"
inner_product_param {
num_output: 1
}
}
Same segment with my changes + training changes:
layer {
name: "cls_prob"
type: "Softmax"
bottom: "fc6_3"
top: "cls_prob"
}
layer {
name: "bbox_reg_3"
type: "InnerProduct"
bottom: "fc5_3"
top: "bbox_reg_3"
param {
lr_mult: 0
decay_mult: 0
}
param {
lr_mult: 0
decay_mult: 0
}
inner_product_param {
num_output: 3
}
}
layer {
name: "rotate_reg_3"
type: "InnerProduct"
bottom: "fc5_3"
top: "rotate_reg_3"
param {
lr_mult: 0
decay_mult: 0
}
param {
lr_mult: 0
decay_mult: 0
}
inner_product_param {
num_output: 1
}
}
layer {
name: "yaw_reg_3"
type: "InnerProduct"
bottom: "fc5_3"
top: "yaw_reg_3"
inner_product_param {
num_output: 1
}
}
layer {
name: "loss"
type: "EuclideanLoss"
bottom: "yaw_reg_3"
bottom: "label"
top: "loss"
}
I've added yaw_reg_3, but i only see rotate_reg_3, bbox_reg_3, and cls_prob loss prints.
Thanks
After debugging caffe itself with gdb:
After going over all the layers, if a layer doesn't appear as a bottom layer for another layer, it is determined as an output layer.
Since "yaw_reg_3" is the bottom for "loss", it is technically not an output layer, so only the loss for it is printed, and not the prediction itself.
I have been using the AlexNet for a pixel-wise regression task (depth estimation). Now I wanted to replace the AlexNet with the VGG net since it is ought to be better.
This is the AlexNet I used:
layer {
name: "train-data"
type: "Data"
top: "data"
include {
phase: TRAIN
}
data_param {
source: "../data/.."
batch_size: 4
backend: LMDB
}
transform_param {
mean_value: 127
}
}
layer {
name: "train-depth"
type: "Data"
top: "gt"
include {
phase: TRAIN
}
transform_param {
# feature scaling coefficient: this maps [0, 255] to [0, 1]
scale: 0.00390625
}
data_param {
source: "../data/.."
batch_size: 4
backend: LMDB
}
}
layer {
name: "val-data"
type: "Data"
top: "data"
include {
phase: TEST
}
data_param {
source: "../data/.."
batch_size: 4
backend: LMDB
}
transform_param {
mean_value: 127
}
}
layer {
name: "val-depth"
type: "Data"
top: "gt"
include {
phase: TEST
}
transform_param {
# feature scaling coefficient: this maps [0, 255] to [0, 1]
scale: 0.00390625
}
data_param {
source: "../data/.."
batch_size: 4
backend: LMDB
}
}
# CONVOLUTIONAL
layer {
name: "conv1"
type: "Convolution"
bottom: "data"
top: "conv1"
param {
lr_mult: 0.02
decay_mult: 1
}
param {
lr_mult: 0.02
decay_mult: 0
}
convolution_param {
num_output: 96
kernel_size: 11
stride: 4
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "relu1"
type: "ReLU"
bottom: "conv1"
top: "conv1"
}
layer {
name: "norm1"
type: "LRN"
bottom: "conv1"
top: "norm1"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layer {
name: "pool1"
type: "Pooling"
bottom: "norm1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layer {
name: "conv2"
type: "Convolution"
bottom: "pool1"
top: "conv2"
param {
lr_mult: 0.02
decay_mult: 1
}
param {
lr_mult: 0.02
decay_mult: 0
}
convolution_param {
engine: CAFFE
num_output: 256
pad: 2
kernel_size: 5
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "relu2"
type: "ReLU"
bottom: "conv2"
top: "conv2"
}
layer {
name: "norm2"
type: "LRN"
bottom: "conv2"
top: "norm2"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layer {
name: "conv3"
type: "Convolution"
bottom: "norm2"
top: "conv3"
param {
lr_mult: 0.02
decay_mult: 1
}
param {
lr_mult: 0.02
decay_mult: 0
}
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "relu3"
type: "ReLU"
bottom: "conv3"
top: "conv3"
}
layer {
name: "conv4"
type: "Convolution"
bottom: "conv3"
top: "conv4"
param {
lr_mult: 0.02
decay_mult: 1
}
param {
lr_mult: 0.02
decay_mult: 0
}
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "relu4"
type: "ReLU"
bottom: "conv4"
top: "conv4"
}
layer {
name: "conv5"
type: "Convolution"
bottom: "conv4"
top: "conv5"
param {
lr_mult: 0.02
decay_mult: 1
}
param {
lr_mult: 0.02
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layer {
name: "relu5"
type: "ReLU"
bottom: "conv5"
top: "conv5"
}
layer {
name: "pool5"
type: "Pooling"
bottom: "conv5"
top: "pool5"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
# MAIN
layer {
name: "fc-main"
type: "InnerProduct"
bottom: "pool5"
top: "fc-main"
param {
decay_mult: 1
}
param {
decay_mult: 0
}
inner_product_param {
num_output: 1024
weight_filler {
type: "xavier"
std: 0.005
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
name: "relu6"
type: "ReLU"
bottom: "fc-main"
top: "fc-main"
relu_param {
engine: CAFFE
}
}
layer {
name: "drop6"
type: "Dropout"
bottom: "fc-main"
top: "fc-main"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
name: "fc-depth"
type: "InnerProduct"
bottom: "fc-main"
top: "fc-depth"
param {
decay_mult: 1
lr_mult: 0.2
}
param {
lr_mult: 0.2
decay_mult: 0
}
inner_product_param {
num_output: 1369
weight_filler {
type: "gaussian"
std: 0.001
}
bias_filler {
type: "constant"
value: 0.5
}
}
}
layer {
name: "reshape"
type: "Reshape"
bottom: "fc-depth"
top: "depth"
reshape_param {
shape {
dim: 0 # copy the dimension from below
dim: 1
dim: 37
dim: 37 # infer it from the other dimensions
}
}
}
layer {
name: "loss"
type: "EuclideanLoss"
bottom: "depth"
bottom: "gt"
top: "loss"
loss_weight: 1
}
This is the VGG I am using:
layer {
bottom: "data"
top: "conv1_1"
name: "conv1_1"
type: "Convolution"
param {
lr_mult: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 64
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv1_2"
top: "conv1_2"
name: "relu1_2"
type: "ReLU"
}
layer {
bottom: "conv1_2"
top: "pool1"
name: "pool1"
type: "Pooling"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layer {
bottom: "pool1"
top: "conv2_1"
name: "conv2_1"
type: "Convolution"
param {
lr_mult: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 128
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 128
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
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: 0.001
decay_mult: 1
}
param {
lr_mult: 0.001
decay_mult: 0
}
convolution_param {
num_output: 512
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layer {
bottom: "conv5_3"
top: "conv5_3"
name: "relu5_3"
type: "ReLU"
}
layer {
bottom: "conv5_3"
top: "pool5"
name: "pool5"
type: "Pooling"
pooling_param {
pool: MAX
kernel_size: 2
stride: 2
}
}
layer {
bottom: "pool5"
top: "fc6"
name: "fc6"
type: "InnerProduct"
param {
lr_mult: 0.1
decay_mult: 1
}
param {
lr_mult: 0.1
decay_mult: 0
}
inner_product_param {
num_output: 4096
weight_filler {
type: "gaussian"
std: 0.001
}
bias_filler {
type: "constant"
value: 0.5
}
}
}
layer {
bottom: "fc6"
top: "fc6"
name: "relu6"
type: "ReLU"
relu_param {
engine: CAFFE
}
}
layer {
name: "drop6"
type: "Dropout"
bottom: "fc6"
top: "fc6"
dropout_param {
dropout_ratio: 0.5
}
}
layer {
bottom: "fc6"
top: "fc7"
name: "fc7"
type: "InnerProduct"
param {
lr_mult: 0.1
decay_mult: 1
}
param {
lr_mult: 0.1
decay_mult: 0
}
inner_product_param {
num_output: 1369
weight_filler {
type: "gaussian"
std: 0.001
}
bias_filler {
type: "constant"
value: 0.5
}
}
}
layer {
name: "reshape"
type: "Reshape"
bottom: "fc7"
top: "depth"
reshape_param {
shape {
dim: 0 # copy the dimension from below
dim: 1
dim: 37
dim: 37 # infer it from the other dimensions
}
}
}
layer {
name: "loss"
type: "EuclideanLoss"
bottom: "depth"
bottom: "gt"
top: "loss"
loss_weight: 1
}
learning_rate is: 0.0005
When training the AlexNet the loss converges to roughly 5 and when using the VGG the net does not converge at all. It always stays at 30, even though I have been decreasing the learning_rate and even decreased mult_lr. Does anyone have any ideas what else could be wrong? I am 100% sure that only the .prototxt files are different, everything else is exactly the same.
It is known that VGG is hard to train from scratch for large networks: in the paper of Simonyan and Zisserman, it is said in section 3.1. In practice, they first train a "small" (A) configuration with random weights then use these weights to initialize larger networks (C-D-E). Moreover, you may need more data to train VGG than AlexNet.
In your case, you may consider to fine-tune VGG16 rather than learning it from scratch. Or let use googlenet that is much lighter (and easier to train) and lead to similar performance on several problems I tested.
I am trying to create a solidguage highchart, but i am not able to align datalabels as per the visual. My code for the chart is:
function dcadjustmentschart() {
$('#adjustments-chart1').highcharts({
chart: {
type: 'solidgauge',
marginTop: 0,
}
},
title: {
text: null,
},
credits : {
enabled : false
},
exporting: {
enabled: false
},
tooltip: {
borderWidth: 0,
enabled: true,
backgroundColor: 'none',
shadow: false,
style: {
fontSize: '16px'
},
positioner: function (labelWidth, labelHeight) {
return {
x: 200 - labelWidth / 2,
y: 180
};
}
},
pane: {
startAngle: 0,
endAngle: 360,
background: [{ // Track for Move
outerRadius: '100%',
innerRadius: '100%',
borderWidth: 2
}]
},
yAxis: {
min: 0,
max: 100,
lineWidth: 0,
tickPositions: []
},
plotOptions: {
solidgauge: {
borderWidth: '5px',
},
dataLabels: {
borderWidth: "0",
marginTop: "0"
}
},
series: [{
enableMouseTracking: false,
name: 'Forward <br/> By <br/> 45',
borderColor: Highcharts.getOptions().colors[0],
data: [{
color: Highcharts.getOptions().colors[0],
radius: '100%',
innerRadius: '100%',
y: 45,
}],
dataLabels: {
formatter: function () {
return this.series.name
},
y: 25,
x: -50,
styles: {
fontSize: "12px",
borderWidth: "0",
fontWeight: "bold",
width: "50px",
marginleft: "50px"
}
}
}]
});
};
Above is the output.
This is what I need:
I want to align the text "Forward by 45" in the center of the circle
I am using <br/> to break the texts to the second line, how to get rid of that?
I want to change the background color of the circle
I think that you have small mistake in your code. Instead of dataLabels.styles you should use dataLabels.style. Here you can see information about this parameter in Highcharts API:
http://api.highcharts.com/highcharts#plotOptions.solidgauge.dataLabels.style
You can use 'text-anchor' property width dataLabels.align and dataLabels.verticalAlign to position your text in the center of you pane:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchor
http://api.highcharts.com/highcharts#plotOptions.solidgauge.dataLabels.align
http://api.highcharts.com/highcharts#plotOptions.solidgauge.dataLabels.verticalAlign
You can add backgroundColor inside your background array:
http://api.highcharts.com/highcharts#pane.background
function dcadjustmentschart() {
$('#container').highcharts({
chart: {
type: 'solidgauge',
marginTop: 0,
},
title: {
text: null,
},
credits: {
enabled: false
},
exporting: {
enabled: false
},
pane: {
startAngle: 0,
endAngle: 360,
background: [{
backgroundColor: '#bada55',
borderWidth: 0,
outerRadius: '100%'
}, {
outerRadius: '100%',
innerRadius: '100%',
borderWidth: 2,
borderColor: 'black'
}],
},
yAxis: {
min: 0,
max: 100,
lineWidth: 0,
tickPositions: []
},
plotOptions: {
solidgauge: {
borderWidth: '5px',
dataLabels: {
padding: 0,
x: 25,
align: 'center',
verticalAlign: 'middle',
}
},
},
series: [{
enableMouseTracking: false,
name: 'Forward By 45',
borderColor: Highcharts.getOptions().colors[0],
data: [{
color: Highcharts.getOptions().colors[0],
radius: '100%',
innerRadius: '100%',
y: 45,
}],
dataLabels: {
overflow: "none",
crop: false,
borderWidth: 0,
formatter: function() {
return this.series.name
},
y: 0,
style: {
fontSize: "12px",
fontWeight: "bold",
width: "50px",
textAnchor: 'middle',
}
}
}]
});
};
dcadjustmentschart()
Here you can see an example how it can work:
http://jsfiddle.net/cune5qs5/25/
Kind regards.
I have a page with some background image.
In body tag I have a svg element with only one inner path element.
How to add backdrop-filter to path element so it could blur background in non-rectangular shape?
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 80,
ease: Strong.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 80,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
delay: 0.15,
ease: Back.easeOut,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
Without doing too many changes to your code, you can achieve that by increasing your power and/or decreasing your offsetTop in the open function.
TweenMax.to(settings, 0.35, {overwrite: true, offsetTop: 80, ease: Strong.easeOut, onUpdate: render })
TweenMax.to(settings, 1, {power: 120, ease: Elastic.easeOut, onUpdate: render })
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 80,
ease: Strong.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 150,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
delay: 0.15,
ease: Back.easeOut,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
Quadratic Bézier curve
Another solution is to add a curved path (called quadratic Bézier curve) to your rectangle. The curve is built like this:
M{startWidth}, {startHeight} q {curvePeak}, {curveHeight}, {endWidth}, {endHeight}
startWidth - x-axis positioning of P0: x coordinate where the curve starts
startHeight - y-axis positioning of P0: y coordinate where the curve starts
curvePeak - x-axis positioning of P1: where the curve reach it's peak
curveHeight - y-axis positioning of P1: height of the curve
endWidth - x-axis positioning of P2: dimension of the curve
endHeight - y-axis positioning of P2: inclination of the curve
See also: Quadratic Bézier Curve: Calculate Points or click here for an interactive example of the quadratic Bézier curve.
Negative
This solution has some problems when using two different animations and duration, like in your case.
Strong.easeOut : 0.35s
Elastic.easeOut : 1.00s
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z q 600, 100, 1200, 0";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 80,
ease: Strong.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 80,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
delay: 0.15,
ease: Back.easeOut,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
Positive
On the contrary it works great when using the same animation and duration.
Both with Elastic.easeOut : 1.00s
$(function() {
var pattern = "M0,{offsetTop} C{ax1},{power},{ax2},{power},{width},{offsetTop} L{width},{height},0,{height}Z q 600, 100, 1200, 0";
var $svg = $('svg#footer');
var $path = $svg.find('path');
var settings = {
width: 1200,
height: 200,
offsetTop: 200,
power: 200
}
settings.ax1 = settings.width / 3 * 1;
settings.ax2 = settings.width / 3 * 2;
function render() {
var newPath = pattern;
for (var i in settings) {
newPath = newPath.split('{' + i + '}').join(settings[i]);
}
$path.attr('d', newPath);
}
TweenMax.set($svg, {
force3D: true
})
var opened = false;
function open() {
if (opened) {
return
}
opened = true;
TweenMax.to(settings, 1, {
overwrite: true,
offsetTop: 80,
ease: Elastic.easeOut,
onUpdate: render
})
TweenMax.to(settings, 1, {
power: 80,
ease: Elastic.easeOut,
onUpdate: render
})
}
function close() {
if (!opened) {
return
}
opened = false;
TweenMax.to(settings, 0.35, {
overwrite: true,
offsetTop: 200,
ease: Back.easeIn,
onUpdate: render
})
TweenMax.to(settings, 0.35, {
power: 200,
ease: Back.easeIn,
onUpdate: render
})
}
$(window).on('mousedown touchstart', function(e) {
opened ? close() : open();
})
open();
})
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
}
body {
background-image: url('http://i839.photobucket.com/albums/zz314/mrkanpuc/stuffs/1PZ1.jpg');
background-repeat: no-repeat;
background-size: cover;
}
svg {
position: absolute;
bottom: 0;
width: 100%;
height: 200px;
}
svg path {
fill: rgba(0, 0, 0, 0.5);
}
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
<svg id="footer" viewBox="0 0 1200 200" preserveAspectRatio="none"><path/></svg>
I trained caffe's Alexnet model for testing with more efficient model. Since my training is for pedestrians my image size is 64 x 80 images. I made changes to prototxt files to match to my trained image size. According to this tutorial, it will be better to set the convolution filter size to match the input image size. So my filter sizes have slight changes from the original Alexnet's provided prototxt files (I trained and tested with Alexnet's original prototxt files and get the same error at the same line mentioned below).
According to my calculation, image sizes after passing each layer will be
80x64x3 -> Conv1 -> 38x30x96
38x30x96 -> Pools -> 18x14x96
18x14x96 -> Conv2 -> 19x15x256
19x15x256 -> Pool2 -> 9x7x256
9x7x256 -> Conv3 -> 9x7x384
9x7x384 -> Conv4 -> 9x7x384
9x7x384 -> Conv5 -> 9x7x256
9x7x256 -> Pool5 -> 4x3x256
The error is at fc6 layer and line number 714 of test_predict_imagenet.cpp. I use test_predict_imagenet.cpp file to test the model.
CHECK_EQ(target_blobs[j]->width(), source_layer.blobs(j).width());
The error is
F0816 22:58:28.328047 3432 net.cpp:714] Check failed: target_blobs[j]->width()
== source_layer.blobs(j).width() (5120 vs. 1024)
I don't understand why it is like that.
My two prototxt files are shown below.
train_val.prototxt
name: "AlexNet"
layers {
name: "data"
type: DATA
top: "data"
top: "label"
data_param {
source: "../../examples/Alexnet/Alexnet_train_leveldb"
batch_size: 200
}
transform_param {
crop_size: 48
mean_file: "../../examples/Alexnet/mean.binaryproto"
mirror: true
}
include: { phase: TRAIN }
}
layers {
name: "data"
type: DATA
top: "data"
top: "label"
data_param {
source: "../../examples/Alexnet/Alexnet_test_leveldb"
batch_size: 200
}
transform_param {
crop_size: 48
mean_file: "../../examples/Alexnet/mean.binaryproto"
mirror: false
}
include: { phase: TEST }
}
layers {
name: "conv1"
type: CONVOLUTION
bottom: "data"
top: "conv1"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 96
kernel_size: 6
stride: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "relu1"
type: RELU
bottom: "conv1"
top: "conv1"
}
layers {
name: "norm1"
type: LRN
bottom: "conv1"
top: "norm1"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layers {
name: "pool1"
type: POOLING
bottom: "norm1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 4
stride: 2
}
}
layers {
name: "conv2"
type: CONVOLUTION
bottom: "pool1"
top: "conv2"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 256
pad: 2
kernel_size: 4
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layers {
name: "relu2"
type: RELU
bottom: "conv2"
top: "conv2"
}
layers {
name: "norm2"
type: LRN
bottom: "conv2"
top: "norm2"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layers {
name: "pool2"
type: POOLING
bottom: "norm2"
top: "pool2"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "conv3"
type: CONVOLUTION
bottom: "pool2"
top: "conv3"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "relu3"
type: RELU
bottom: "conv3"
top: "conv3"
}
layers {
name: "conv4"
type: CONVOLUTION
bottom: "conv3"
top: "conv4"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layers {
name: "relu4"
type: RELU
bottom: "conv4"
top: "conv4"
}
layers {
name: "conv5"
type: CONVOLUTION
bottom: "conv4"
top: "conv5"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layers {
name: "relu5"
type: RELU
bottom: "conv5"
top: "conv5"
}
layers {
name: "pool5"
type: POOLING
bottom: "conv5"
top: "pool5"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "fc6"
type: INNER_PRODUCT
bottom: "pool5"
top: "fc6"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 4096
weight_filler {
type: "gaussian"
std: 0.005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layers {
name: "relu6"
type: RELU
bottom: "fc6"
top: "fc6"
}
layers {
name: "drop6"
type: DROPOUT
bottom: "fc6"
top: "fc6"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "fc7"
type: INNER_PRODUCT
bottom: "fc6"
top: "fc7"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 4096
weight_filler {
type: "gaussian"
std: 0.005
}
bias_filler {
type: "constant"
value: 0.1
}
}
}
layers {
name: "relu7"
type: RELU
bottom: "fc7"
top: "fc7"
}
layers {
name: "drop7"
type: DROPOUT
bottom: "fc7"
top: "fc7"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "fc8"
type: INNER_PRODUCT
bottom: "fc7"
top: "fc8"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "accuracy"
type: ACCURACY
bottom: "fc8"
bottom: "label"
top: "accuracy"
include: { phase: TEST }
}
layers {
name: "loss"
type: SOFTMAX_LOSS
bottom: "fc8"
bottom: "label"
top: "loss"
}
This is the testing file for the model.
deploy.txt
name: "AlexNet"
layers
{
name: "data"
type: MEMORY_DATA
top: "data"
top: "label"
memory_data_param
{
batch_size: 1
channels: 3
height: 80
width: 64
}
transform_param
{
crop_size: 64
mirror: false
mean_file: "../../examples/Alexnet/mean.binaryproto"
}
}
layers {
name: "conv1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 96
kernel_size: 6
stride: 2
}
bottom: "data"
top: "conv1"
}
layers {
name: "relu1"
type: RELU
bottom: "conv1"
top: "conv1"
}
layers {
name: "norm1"
type: LRN
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
bottom: "conv1"
top: "norm1"
}
layers {
name: "pool1"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
bottom: "norm1"
top: "pool1"
}
layers {
name: "conv2"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 256
pad: 2
kernel_size: 4
group: 2
}
bottom: "pool1"
top: "conv2"
}
layers {
name: "relu2"
type: RELU
bottom: "conv2"
top: "conv2"
}
layers {
name: "norm2"
type: LRN
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
bottom: "conv2"
top: "norm2"
}
layers {
name: "pool2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
bottom: "norm2"
top: "pool2"
}
layers {
name: "conv3"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
}
bottom: "pool2"
top: "conv3"
}
layers {
name: "relu3"
type: RELU
bottom: "conv3"
top: "conv3"
}
layers {
name: "conv4"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
group: 2
}
bottom: "conv3"
top: "conv4"
}
layers {
name: "relu4"
type: RELU
bottom: "conv4"
top: "conv4"
}
layers {
name: "conv5"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
group: 2
}
bottom: "conv4"
top: "conv5"
}
layers {
name: "relu5"
type: RELU
bottom: "conv5"
top: "conv5"
}
layers {
name: "pool5"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
bottom: "conv5"
top: "pool5"
}
layers {
name: "fc6"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 4096
}
bottom: "pool5"
top: "fc6"
}
layers {
name: "relu6"
type: RELU
bottom: "fc6"
top: "fc6"
}
layers {
name: "drop6"
type: DROPOUT
dropout_param {
dropout_ratio: 0.5
}
bottom: "fc6"
top: "fc6"
}
layers {
name: "fc7"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 4096
}
bottom: "fc6"
top: "fc7"
}
layers {
name: "relu7"
type: RELU
bottom: "fc7"
top: "fc7"
}
layers {
name: "drop7"
type: DROPOUT
dropout_param {
dropout_ratio: 0.5
}
bottom: "fc7"
top: "fc7"
}
layers {
name: "fc8"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 2
}
bottom: "fc7"
top: "fc8"
}
layers {
name: "prob"
type: SOFTMAX
bottom: "fc8"
top: "prob"
}
What is wrong with this error?
Those who have the same problem as i faced, please look at the prototxt files shown below. There are some modifications made compared to the original prototxt files provided in the downloaded folders. I used 80x64 image sizes for the input in training and testing.
Train_val.prototxt
name: "AlexNet"
layers {
name: "data"
type: DATA
top: "data"
top: "label"
data_param {
source: "../../examples/Alexnet_2/Alexnet_train_leveldb"
batch_size: 100
}
transform_param {
mean_file: "../../examples/Alexnet_2/mean.binaryproto"
}
include: { phase: TRAIN }
}
layers {
name: "data"
type: DATA
top: "data"
top: "label"
data_param {
source: "../../examples/Alexnet_2/Alexnet_test_leveldb"
batch_size: 100
}
transform_param {
mean_file: "../../examples/Alexnet_2/mean.binaryproto"
}
include: { phase: TEST }
}
layers {
name: "conv1"
type: CONVOLUTION
bottom: "data"
top: "conv1"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 96
kernel_size: 11
stride: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "relu1"
type: RELU
bottom: "conv1"
top: "conv1"
}
layers {
name: "pool1"
type: POOLING
bottom: "conv1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "norm1"
type: LRN
bottom: "pool1"
top: "norm1"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layers {
name: "conv2"
type: CONVOLUTION
bottom: "norm1"
top: "conv2"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 256
pad: 2
kernel_size: 5
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 1
}
}
}
layers {
name: "relu2"
type: RELU
bottom: "conv2"
top: "conv2"
}
layers {
name: "pool2"
type: POOLING
bottom: "conv2"
top: "pool2"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "norm2"
type: LRN
bottom: "pool2"
top: "norm2"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layers {
name: "conv3"
type: CONVOLUTION
bottom: "norm2"
top: "conv3"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "relu3"
type: RELU
bottom: "conv3"
top: "conv3"
}
layers {
name: "conv4"
type: CONVOLUTION
bottom: "conv3"
top: "conv4"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 1
}
}
}
layers {
name: "relu4"
type: RELU
bottom: "conv4"
top: "conv4"
}
layers {
name: "conv5"
type: CONVOLUTION
bottom: "conv4"
top: "conv5"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
group: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 1
}
}
}
layers {
name: "relu5"
type: RELU
bottom: "conv5"
top: "conv5"
}
layers {
name: "pool5"
type: POOLING
bottom: "conv5"
top: "pool5"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "fc6"
type: INNER_PRODUCT
bottom: "pool5"
top: "fc6"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 4096
weight_filler {
type: "gaussian"
std: 0.005
}
bias_filler {
type: "constant"
value: 1
}
}
}
layers {
name: "relu6"
type: RELU
bottom: "fc6"
top: "fc6"
}
layers {
name: "drop6"
type: DROPOUT
bottom: "fc6"
top: "fc6"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "fc7"
type: INNER_PRODUCT
bottom: "fc6"
top: "fc7"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 4096
weight_filler {
type: "gaussian"
std: 0.005
}
bias_filler {
type: "constant"
value: 1
}
}
}
layers {
name: "relu7"
type: RELU
bottom: "fc7"
top: "fc7"
}
layers {
name: "drop7"
type: DROPOUT
bottom: "fc7"
top: "fc7"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "fc8"
type: INNER_PRODUCT
bottom: "fc7"
top: "fc8"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "accuracy"
type: ACCURACY
bottom: "fc8"
bottom: "label"
top: "accuracy"
include: { phase: TEST }
}
layers {
name: "loss"
type: SOFTMAX_LOSS
bottom: "fc8"
bottom: "label"
top: "loss"
}
test.prototxt
name: "CaffeNet"
layers
{
name: "data"
type: MEMORY_DATA
top: "data"
top: "label"
memory_data_param
{
batch_size: 1
channels: 3
height: 80
width: 64
}
transform_param
{
crop_size: 64
mirror: false
mean_file: "../../examples/Alexnet_2/mean.binaryproto"
}
}
layers {
name: "conv1"
type: CONVOLUTION
bottom: "data"
top: "conv1"
convolution_param {
num_output: 96
kernel_size: 11
stride: 2
}
}
layers {
name: "relu1"
type: RELU
bottom: "conv1"
top: "conv1"
}
layers {
name: "pool1"
type: POOLING
bottom: "conv1"
top: "pool1"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "norm1"
type: LRN
bottom: "pool1"
top: "norm1"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layers {
name: "conv2"
type: CONVOLUTION
bottom: "norm1"
top: "conv2"
convolution_param {
num_output: 256
pad: 2
kernel_size: 5
group: 2
}
}
layers {
name: "relu2"
type: RELU
bottom: "conv2"
top: "conv2"
}
layers {
name: "pool2"
type: POOLING
bottom: "conv2"
top: "pool2"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "norm2"
type: LRN
bottom: "pool2"
top: "norm2"
lrn_param {
local_size: 5
alpha: 0.0001
beta: 0.75
}
}
layers {
name: "conv3"
type: CONVOLUTION
bottom: "norm2"
top: "conv3"
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
}
}
layers {
name: "relu3"
type: RELU
bottom: "conv3"
top: "conv3"
}
layers {
name: "conv4"
type: CONVOLUTION
bottom: "conv3"
top: "conv4"
convolution_param {
num_output: 384
pad: 1
kernel_size: 3
group: 2
}
}
layers {
name: "relu4"
type: RELU
bottom: "conv4"
top: "conv4"
}
layers {
name: "conv5"
type: CONVOLUTION
bottom: "conv4"
top: "conv5"
convolution_param {
num_output: 256
pad: 1
kernel_size: 3
group: 2
}
}
layers {
name: "relu5"
type: RELU
bottom: "conv5"
top: "conv5"
}
layers {
name: "pool5"
type: POOLING
bottom: "conv5"
top: "pool5"
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
name: "fc6"
type: INNER_PRODUCT
bottom: "pool5"
top: "fc6"
inner_product_param {
num_output: 4096
}
}
layers {
name: "relu6"
type: RELU
bottom: "fc6"
top: "fc6"
}
layers {
name: "drop6"
type: DROPOUT
bottom: "fc6"
top: "fc6"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "fc7"
type: INNER_PRODUCT
bottom: "fc6"
top: "fc7"
inner_product_param {
num_output: 4096
}
}
layers {
name: "relu7"
type: RELU
bottom: "fc7"
top: "fc7"
}
layers {
name: "drop7"
type: DROPOUT
bottom: "fc7"
top: "fc7"
dropout_param {
dropout_ratio: 0.5
}
}
layers {
name: "fc8"
type: INNER_PRODUCT
bottom: "fc7"
top: "fc8"
inner_product_param {
num_output: 2
}
}
layers {
name: "prob"
type: SOFTMAX
bottom: "fc8"
top: "prob"
}
layers {
name: "output"
type: ARGMAX
bottom: "prob"
top: "output"
}