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

Question: Possible error in the model specifications #1409

Closed
kimoyerr opened this issue Sep 17, 2020 · 1 comment · Fixed by TuringLang/docs#85
Closed

Question: Possible error in the model specifications #1409

kimoyerr opened this issue Sep 17, 2020 · 1 comment · Fixed by TuringLang/docs#85

Comments

@kimoyerr
Copy link

Question on: https://github.com/TuringLang/Turing.jl/edit/master/docs/_tutorials/8_MultinomialLogisticRegression.md

num = softmax([0, # this 0 corresponds to the base category `setosa`
                     intercept_versicolor + SepalLength_versicolor*x[i, 1] +
                                            SepalWidth_versicolor*x[i, 1] +
                                            PetalLength_versicolor*x[i, 2] +
                                            PetalWidth_versicolor*x[i, 2],
                     intercept_virginica + SepalLength_virginica*x[i, 3] +
                                           SepalWidth_virginica*x[i, 3] +
                                           PetalLength_virginica*x[i, 4] +
                                           PetalWidth_virginica*x[i, 4]])

should this be instead?

num = softmax([0, # this 0 corresponds to the base category `setosa`
                     intercept_versicolor + SepalLength_versicolor*x[i, 1] +
                                            SepalWidth_versicolor*x[i, 2] +
                                            PetalLength_versicolor*x[i, 3] +
                                            PetalWidth_versicolor*x[i, 4],
                     intercept_virginica + SepalLength_virginica*x[i, 1] +
                                           SepalWidth_virginica*x[i, 2] +
                                           PetalLength_virginica*x[i, 3] +
                                           PetalWidth_virginica*x[i, 4]])
@devmotion
Copy link
Member

Yes, seems like this is incorrect. There is also some leaking from the training to the test data it seems. In general, it would be good to update the tutorial to be more similar to https://turing.ml/dev/tutorials/5-linearregression/.

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

Successfully merging a pull request may close this issue.

2 participants