Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when specifying an error function #36

Open
WinAuthFan opened this issue Jul 5, 2020 · 4 comments
Open

Error when specifying an error function #36

WinAuthFan opened this issue Jul 5, 2020 · 4 comments

Comments

@WinAuthFan
Copy link

# This is the example from ?neuralnet
library(neuralnet)
nn <- neuralnet(Species == "setosa" ~ Petal.Length + Petal.Width, iris, linear.output = FALSE)

# The default error function is half of SSE, as seen here:
nn$err.fct
# function (x, y) 
# {
#     1/2 * (y - x)^2
# }


# Now, let's specify this error function. We will use the exact same error function as the default:
my.err.fct = function (x, y) 
{
    1/2 * (y - x)^2
}
nn <- neuralnet(Species == "setosa" ~ Petal.Length + Petal.Width, iris, linear.output = FALSE,
	err.fct = my.err.fct)
# error!
@mnwright
Copy link
Member

mnwright commented Jul 6, 2020

That's a bug in the CRAN version, which is already fixed on Github. You'll have to install the Github version until it is on CRAN, e.g. with

devtools::install_github("bips-hb/neuralnet")

@azhen1004
Copy link

Hello, I have encountered a similar problem, according to your answer to update the version, still unable to successfully build the neural network I need. Do you have related guidance documents to let me learn the details? Thanks very much.

@mnwright
Copy link
Member

The change is still not on CRAN, sorry.

@azhen1004
Copy link

The change is still not on CRAN, sorry.

Thank you for your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants