[Amore-commits] predict is up and running

Manuel Castejón Limas manuel.castejon at gmail.com
Tue Jul 26 02:00:57 CEST 2011


Predict is working now!
Each row of the input matrix feeds one input neuron (number of rows equal to
number of input neurons, number of cols equal to number of patterns
entered). Similarly for the output.
Now it's time for coding some training algorithms.
Greetings.
Manuel

incCode <- paste(readLines( "pkg/AMORE/src/AMORE.h"), collapse = "\n" )

testCode <- ""

testCodefun <- cfunction(sig=signature(), body=testCode,includes=incCode,
otherdefs="using namespace Rcpp;", language="C++", verbose=FALSE,
convention=".Call",Rcpp=TRUE,cppargs=character(), cxxargs=
paste("-I",getwd(),"/pkg/AMORE/src -I/opt/local/include",sep=""),
libargs=character())

modAMORE <- Module("mod_AMORE",  getDynLib(testCodefun))



AMOREnet <- modAMORE$NetworkRinterface

net <- new (AMOREnet)

checkTrue(!net$validate())

net$createFeedForwardNetwork(c(3,2,2))

checkTrue(net$validate())

checkEquals(net$inputSize(),3)

checkEquals(net$outputSize(),2)

net$predict(matrix(rnorm(120),  nrow=4))

# Error en net$predict(matrix(rnorm(120), nrow = 4)) :

# Incorrect number or rows. The number of input neurons must be equal to the
number of rows of the input matrix.



net$predict(matrix(rnorm(120), nrow=3))

#            [,1]       [,2]       [,3]       [,4]      [,5]      [,6]
[,7]

# [1,] 0.02681736 0.07433409 0.01767159 -0.1072734 0.1360815 0.1834029
-0.1090389

# [2,] 0.19422827 0.17101272 0.40341796  0.1914221 0.2700953 0.3545197
0.4690332

#            [,8]       [,9]     [,10]     [,11]      [,12]       [,13]

# [1,] -0.3030112 0.07199258 0.1143015 0.3794277 -0.2317072 -0.01846044

# [2,]  0.2757496 0.38433156 0.2623157 0.3432154  0.2677981  0.22514373

#           [,14]      [,15]     [,16]     [,17]      [,18]      [,19]
[,20]

# [1,] -0.2164891 0.08567291 0.1095074 0.2229317 0.07758518 0.09288609
0.3453419

# [2,]  0.2332822 0.24119018 0.3440743 0.3292969 0.38808119 0.22780870
0.4156303

#          [,21]      [,22]      [,23]        [,24]     [,25]      [,26]

# [1,] 0.4349757 -0.1830373 0.05191082 -0.005862106 0.2553146 -0.0978473

# [2,] 0.4172153  0.2181115 0.36326342  0.431352475 0.2106724  0.2937326

#          [,27]      [,28]     [,29]      [,30]     [,31]      [,32]
[,33]

# [1,] 0.2295301 0.09906594 0.3577109 -0.1262453 0.5179862 -0.2170925
0.06610679

# [2,] 0.3424702 0.41603398 0.2761284  0.1568972 0.4035570  0.2580692
0.35818618

#           [,34]      [,35]      [,36]      [,37]      [,38]     [,39]

# [1,] -0.1537457 -0.1689704 -0.3461895 0.04026574 -0.1570952 0.2549960

# [2,]  0.3343655  0.3647931  0.4533143 0.45506059  0.3021554 0.2001179

#            [,40]

# [1,] -0.02331876

# [2,]  0.24338064




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/amore-commits/attachments/20110726/d97d7daa/attachment.htm>


More information about the Amore-commits mailing list