view test_mlp.py @ 204:62c7527c9ec1

debugging mlp.py
author Yoshua Bengio <bengioy@iro.umontreal.ca>
date Wed, 14 May 2008 14:06:15 -0400
parents 2698c0feeb54
children 25d0a0c713da
line wrap: on
line source


from mlp import *
import dataset

def test0():
    nnet = OneHiddenLayerNNetClassifier(10,2,.001,1000)
    training_set = dataset.ArrayDataSet(numpy.array([[0, 0, 0],
                                                     [0, 1, 1],
                                                     [1, 0, 1],
                                                     [1, 1, 1]]),
                                        {'input':slice(2),'target':2})
    fprop=nnet(training_set)

    output_ds = fprop(training_set)

    for fieldname in output_ds.fieldNames():
        print fieldname+"=",output_ds[fieldname]

test0()