Skip to content

Conversation

@breznak
Copy link
Member

@breznak breznak commented Apr 22, 2020

  • fixed type for possible integer underflow in SP
  • default seed is "random" (0). Also in Python.
  • use directly fixed seed where needed in tests for deterministic
    results. (for this added c++ helper methods setSeed(UInt) )
  • fix docs
  • update tests

To be used by NAB detector.

For use in #792 ,

breznak added 2 commits April 22, 2020 19:46
- fixed type for possible integer underflow in SP
- default seed is "random" (0). Also in Python.
- use directly fixed seed where needed in tests for deterministic
results. (for this added c++ helper methods `setSeed(UInt)` )
- fix docs
- update tests

To be used by NAB detector.
@breznak breznak added the code code enhancement, optimization, cleanup..programmer stuff label Apr 22, 2020
@breznak breznak requested a review from dkeeney April 22, 2020 17:52
Copy link
Member Author

@breznak breznak left a comment

Choose a reason for hiding this comment

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

@dkeeney could you have a look with me please?
Most changes ironed out, but there's something stinky in the SP's seed, serialization. I recall a user reporting a bug here with different results with a SP loaded from serialized state.


//uses fixed seed for deterministic output checks:
Random rnd(42);
spGlobal.setSeed(1);
Copy link
Member Author

Choose a reason for hiding this comment

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

a strange thing is happening here, I set the rng_ to fixed seed (1 used to be used before) ...but determ. output is still changing!

Argument seed Seed for our random number generator. If seed is < 0
Argument seed Seed for our random number generator. If seed is 0
Copy link
Member Author

Choose a reason for hiding this comment

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

corrected the doc strings

, py::arg("dutyCyclePeriod") = 1000
, py::arg("boostStrength") = 0.0
, py::arg("seed") = 1
, py::arg("seed") = 0
Copy link
Member Author

Choose a reason for hiding this comment

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

changed the defaults to "random" (0) in cpp, py, NetworkAPI

testTimer.stop();

EXPECT_EQ(outputBaseline, outputC);
EXPECT_EQ(outputBaseline, outputC); //FIXME this test randomly fails. (De/serialization of rng_ is correct?)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is another test that is inconsistent! Sometimes it passes, sometimes crashes on different outputs. I can't see why would that be, the test is relatively simple and seems correct.
I'm suspecting something with serizalization of Random?
Even more confusing is why HellpSPTP fails undeterministically now?

dkeeney
dkeeney previously approved these changes Apr 22, 2020
Copy link

@dkeeney dkeeney left a comment

Choose a reason for hiding this comment

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

I took a quick look at the Random code and it looks ok. Nothing obvious that might cause it to fail.

breznak added 9 commits April 27, 2020 17:32
I need more precise detail if/why two SPs differ.
these are helper data classes that hold "heavy" info on connections:
SegmentData, SynapseData
to be more descriptive when difference is found.
Useful for debugging.
apparently improper combination of cereal::make_nvp()
and CEERAL_NVP(). Only the latter should be used.

Finished simplified Conn serialization, only data-members are directly
serialized. No need to call initialize() and other functions manually.
@breznak
Copy link
Member Author

breznak commented Jun 3, 2020

Waiting for bigger changes in #601 , after that I should debug this.

@breznak breznak self-assigned this Jun 3, 2020
dkeeney
dkeeney previously approved these changes Jun 4, 2020
Copy link

@dkeeney dkeeney left a comment

Choose a reason for hiding this comment

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

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code code enhancement, optimization, cleanup..programmer stuff serializable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants