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

Coot 12, refactor, arma::min, arma::imbue and some other bugs #3643

Merged
merged 8 commits into from
Mar 21, 2024

Conversation

shrit
Copy link
Member

@shrit shrit commented Feb 29, 2024

Hi,

There is still one single test that is failing and I am not able to figure out where the issue is coming from. Here is the test failure:

./bin/mlpack_test
mlpack version: mlpack git-a62b12d4ed
armadillo version: 12.6.1 (Cortisol Retox)
random seed: 0
terminate called after throwing an instance of 'std::logic_error'
  what():  as_scalar(): expression must evaluate to exactly one element

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mlpack_test is a Catch v2.13.10 host application.
Run with -? for options

-------------------------------------------------------------------------------
OneStepQLearningTest
-------------------------------------------------------------------------------
/meta/mlpack/src/mlpack/tests/ann/async_learning_test.cpp:21
...............................................................................

/meta/mlpack/src/mlpack/tests/ann/async_learning_test.cpp:21: FAILED:
due to a fatal error condition:
  SIGABRT - Abort (abnormal termination) signal

===============================================================================
test cases:     204 |     203 passed | 1 failed
assertions: 1070829 | 1070828 passed | 1 failed

[3]    3152935 IOT instruction (core dumped)  ./bin/mlpack_test

The issue here is that there are two as_scalar that are left in methods that could be used here, and both of them are being used correctly, (evaluate a vector and return a scalar).

I am also pretty sure that in a lot of places we can remove arma::as_scalar since it is used for no reason

Signed-off-by: Omar Shrit <omar@avontech.fr>
Signed-off-by: Omar Shrit <omar@avontech.fr>
Signed-off-by: Omar Shrit <omar@avontech.fr>
@shrit
Copy link
Member Author

shrit commented Feb 29, 2024

@rcurtin I think we need to upgrade armadillo version in here

Signed-off-by: Omar Shrit <omar@avontech.fr>
Signed-off-by: Omar Shrit <omar@avontech.fr>
Signed-off-by: Omar Shrit <omar@avontech.fr>
@shrit
Copy link
Member Author

shrit commented Mar 14, 2024

@rcurtin this is good from my end, I am not adding anything here.
Let us see if we can merge it before the weekend

Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two really minor comments, otherwise, looks good to me. Sorry the review took so long 👍

src/mlpack/methods/ann/init_rules/gaussian_init.hpp Outdated Show resolved Hide resolved
@@ -117,7 +117,7 @@ TEST_CASE("PReLUIntegrationTest", "[ANNLayerTest]")
model.Add<Linear>(3);
model.Add<PReLU>(0.01);
model.Add<Linear>(1);

model.InputDimensions() = std::vector<size_t>({trainData.n_rows});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this shouldn't be needed---I believe if the input dimensions are left unset, the input is assumed to be a 1D tensor with number of elements equal to the number of rows in the matrix. Did you find that you needed to add this line, or will the test work without it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test was failing without it, so I have no idea, the dimensions were set up manually everywhere else.
Technically you are right, it is not necessary, but at the same time, the test was failing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to reproduce this locally, and I found that I could make a test failure happen with or without the code. It also doesn't look as simple as adjusting tolerances, I think there may be an invalid memory access in a different test that sometimes affects this one. Hopefully we can solve that, but here is not the place... up to you whether you want to remove this line or keep it there. 👍

Signed-off-by: Omar Shrit <omar@avontech.fr>
Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the fixes 👍

@@ -117,7 +117,7 @@ TEST_CASE("PReLUIntegrationTest", "[ANNLayerTest]")
model.Add<Linear>(3);
model.Add<PReLU>(0.01);
model.Add<Linear>(1);

model.InputDimensions() = std::vector<size_t>({trainData.n_rows});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to reproduce this locally, and I found that I could make a test failure happen with or without the code. It also doesn't look as simple as adjusting tolerances, I think there may be an invalid memory access in a different test that sometimes affects this one. Hopefully we can solve that, but here is not the place... up to you whether you want to remove this line or keep it there. 👍

@shrit
Copy link
Member Author

shrit commented Mar 20, 2024

okay, I will remove it tomorrow morning

Signed-off-by: Omar Shrit <omar@avontech.fr>
Copy link

@mlpack-bot mlpack-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval provided automatically after 24 hours. 👍

@shrit shrit merged commit ac88020 into mlpack:master Mar 21, 2024
18 of 20 checks passed
@shrit shrit deleted the coot_12 branch March 21, 2024 20:05
This was referenced May 26, 2024
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 this pull request may close these issues.

None yet

2 participants