max pooling on input data layer (training broken)?

5 views
Skip to first unread message

mczenfold

unread,
Jan 31, 2017, 7:09:04 PM1/31/17
to Caffe Users
Hi all, I define and train my network as so in Python:  

  n = caffe.NetSpec()
    n.data, n.label = L.Data(batch_size=batch_size, backend=P.Data.LMDB, source=lmdb, ntop=2)
    n.pool1 = L.Pooling(n.data, kernel_h=2, kernel_w=2, stride=2, pool=P.Pooling.MAX)
    n.conv2 = L.Convolution(n.pool1, kernel_h=1, kernel_w=20, num_output=40, weight_filler=dict(type='xavier'))
    n.pool2 = L.Pooling(n.conv2, kernel_h=1, kernel_w=2, stride=2, pool=P.Pooling.MAX)
    n.fc1   = L.InnerProduct(n.pool2, num_output=100, weight_filler=dict(type='xavier'))
    n.drop  = L.Dropout(n.fc1, in_place=True, dropout_ratio=0.5)
    n.relu1 = L.ReLU(n.drop, in_place=True)
    n.score = L.InnerProduct(n.relu1, num_output=1)
    n.loss  = L.EuclideanLoss(n.score, n.label)
    return n.to_proto()



As you can see, I'm hoping to use the first layer of my network to me a max pooling layer on the input data...normally the model trains just fine if I don't do this, but in this scenario I get output like this:

I0201 00:03:58.406731  7533 solver.cpp:404]     Test net output #0: loss = 0 (* 1 = 0 loss)
I0201 00:03:58.710309  7533 solver.cpp:228] Iteration 400, loss = 0
I0201 00:03:58.710382  7533 solver.cpp:244]     Train net output #0: loss = 0 (* 1 = 0 loss)
I0201 00:03:58.710402  7533 sgd_solver.cpp:106] Iteration 400, lr = 0.000971013


Where the loss = 0 at all iterations...it's not intuitive to my why it's not possible to have a max pooling operation like this on the input data....any ideas where the problem lies??

Thanks in advance for any help!
Reply all
Reply to author
Forward
0 new messages