Created
January 30, 2017 05:39
-
-
Save gowrishankarin/d9df1acf40fcb1acbbcf215f9f762897 to your computer and use it in GitHub Desktop.
Multi Layer Perceptron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library((neuralnet) | |
library(NeuralNetTools) | |
CAPITAL_LETTER <- c(rep(0, 7), 1) | |
SMALL_LETTER <- c(0, rep(1, 7)) | |
binaryData <- data.frame( | |
expand.grid(c(0, 1), c(0, 1), c(0, 1)), CAPITAL_LETTER, SMALL_LETTER | |
) | |
colnames(binaryData) <- c("X_Points", "Y_Points", "Velocity", "CAPITAL_LETTER", "SMALL_LETTER") | |
mod <- neuralnet( | |
CAPITAL_LETTER + SMALL_LETTER ~ X_Points + Y_Points + Velocity, | |
data=binaryData, | |
hidden=c(3, 6, 4), | |
rep= 10, | |
err.fct='ce', | |
linear.output=FALSE | |
) | |
par(mar = numeric(4), family = 'serif') | |
plot(mod, alpha = 0.6) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment