def __init__(self): # https://keras.io/examples/vision/mnist_convnet/ conv = 3 #inter_chan, out_chan = 32, 64 inter_chan, out_chan = 8, 16 # for speed self.c1 = Tensor(layer_init_uniform(inter_chan, 1, conv, conv)) self.c2 = Tensor(layer_init_uniform(out_chan, inter_chan, conv, conv)) self.l1 = Tensor(layer_init_uniform(out_chan * 5 * 5, 10))
def __init__(self): conv = 5 chans = 16 self.c1 = Tensor(layer_init_uniform(chans,1,conv,conv)) self.l1 = Tensor(layer_init_uniform(((28-conv+1)**2)*chans, 128)) self.l2 = Tensor(layer_init_uniform(128, 10))
def __init__(self): self.l1 = Tensor(layer_init_uniform(784, 128)) self.l2 = Tensor(layer_init_uniform(128, 10))