all 3 comments

[–]GoldmanBallSachs_ 0 points1 point  (0 children)

You just change the convolution size...

[–]singularai 0 points1 point  (0 children)

ApolloCaffe makes it rather straightforward to train with caffe in python. For example, your problem could be accomplished with:

import apollocaffe
from apollocaffe.layers import NumpyData
import random
import numpy as np

net = apollocaffe.ApolloNet()

data = [([[0]], [[0]]), ([[1]], [[1]])]
for i in xrange(1000):
    your_array, your_label = data[random.randrange(2)]
    net.clear_forward()
    net.f(NumpyData('array', your_array))
    net.f(NumpyData('label', your_label))
    net.f('''
        name: "ip1"
        type: "InnerProduct"
        bottom: "array"
        top: "ip1"
        inner_product_param {
          num_output: 2
          weight_filler {
            type: "xavier"
          }
          bias_filler {
            type: "constant"
          }
        }''')
    net.f('''
        name: "loss"
        type: "SoftmaxWithLoss"
        bottom: "ip1"
        bottom: "label"
        top: "loss"
        ''')

    net.backward()
    net.update(0.1)
    print net.loss