Skip to content
Snippets Groups Projects
Commit b3a36bed authored by Felix Ramnelöv's avatar Felix Ramnelöv
Browse files

Lab 3: Fixed error in assignment 4

parent ac78ef3b
No related branches found
No related tags found
No related merge requests found
...@@ -180,36 +180,36 @@ Var2 <- runif(500, 0, 10) ...@@ -180,36 +180,36 @@ Var2 <- runif(500, 0, 10)
mydata2 <- data.frame(Sin2 = sin(Var2), Var2) mydata2 <- data.frame(Sin2 = sin(Var2), Var2)
formula1 <- Sin2 ~ Var2 formula2 <- Var2 ~ Sin2
nn2 <- neuralnet( nn2 <- neuralnet(
formula1 , formula2 ,
data = mydata2, data = mydata2,
hidden = c(10), hidden = c(10),
startweights = winit startweights = winit,
threshold = 0.1
) )
plot( plot(
mydata2, mydata2,
cex = 2, col = "blue",
cex = 1,
main = "NN with logistic activation function", main = "NN with logistic activation function",
xlab = "sin(x)", xlab = "sin(x)",
ylab = "x", ylab = "x",
ylim = c(-2, 10)
) )
points(mydata2, col = "blue", cex = 1)
points(mydata2[, 1], points(mydata2[, 1],
predict(nn2, mydata2), predict(nn2, mydata2),
col = "red", col = "red",
cex = 1) cex = 1)
grid() grid()
legend( legend(
"topleft", "bottomleft",
legend = c("Training data", "Test data", "Predicted test data"), legend = c("Training data", "Predicted training data"),
col = c("black", "blue", "red"), col = c("blue", "red"),
pch = 1, pch = 1,
pt.cex = c(2, 1, 1), pt.cex = c(1, 1),
cex = 1 cex = 1
) )
......
This diff is collapsed.
lab3/figures/assignment4-5.png

10.2 KiB | W: | H:

lab3/figures/assignment4-5.png

8.48 KiB | W: | H:

lab3/figures/assignment4-5.png
lab3/figures/assignment4-5.png
lab3/figures/assignment4-5.png
lab3/figures/assignment4-5.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
C = \frac{1}{2n\lambda}. C = \frac{1}{2n\lambda}.
$$ $$
[p. 211] [p. 209-211]
- _In neural networks, what do we mean by mini-batch and epoch?_ - _In neural networks, what do we mean by mini-batch and epoch?_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment