view test_mlp.py @ 167:4803cb76e26b

Updated documentation
author Joseph Turian <turian@gmail.com>
date Mon, 12 May 2008 18:51:42 -0400
parents 0d8e721cc63c
children 2698c0feeb54
line wrap: on
line source


from mlp import *
import dataset

def test0():
    nnet = OneHiddenLayerNNetClassifier(10,3,.1,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()