Пример #1
0
def test_simple_mlp_creating():
    X = cn.ParameterInput([20, 784], "X")
    Y = cn.ParameterInput([20, 10], "Y")
    hl = cn.mlp_layer(X, 100, cn.mlp_layer_opts().tanh().group("hl"))
    lr = cn.logistic_regression(hl.output, Y, False)

    with open("bla.dot", "w") as dotfile:
        dotfile.write(lr.loss.dot(True))

    dw = xdot.DotWindow()
    dw.connect('destroy', gtk.main_quit)
    dw.set_filter('dot')
    dw.set_dotcode(lr.loss.dot(True))
    gtk.main()
Пример #2
0
 def build(self, X, Y):
     return cn.logistic_regression(X, Y, self.n_classes, self.dropout)