Implement multidimensional discrete distribution #810

Closed
rcurtin opened this Issue Nov 8, 2016 · 12 comments

Comments

Projects
None yet
4 participants
@rcurtin
Member

rcurtin commented Nov 8, 2016

See #809 for the discussion that led to this ticket.

Currently, the DiscreteDistribution class in src/mlpack/core/dists/ only supports single-dimension discrete inputs (like (1), (2), (5), etc.). It would be very useful if it instead supported multi-dimensional discrete inputs (like (1, 2, 3), (3, 5, 8), (1, 7, 5)). So the DiscreteDistribution class can easily be extended to support that case. Right now, in the single dimension case, the probability of some input X is simply stored as P(X). Now, with multi-dimensional inputs x_1, x_2, ..., x_d, the probability should be P(x_1) P(x_2) ... P(x_d) (just single-dimension probabilities multiplied).

When we close this ticket it should be possible to train multi-dimensional discrete HMMs with the mlpack_hmm_train program, and there should also be tests for the multi-dimensional support in src/mlpack/tests/distribution_test.cpp.

@MikeLing

This comment has been minimized.

Show comment
Hide comment
@MikeLing

MikeLing Dec 11, 2016

Contributor

Hey @rcurtin , I would like to take this issue :)

Contributor

MikeLing commented Dec 11, 2016

Hey @rcurtin , I would like to take this issue :)

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Dec 12, 2016

Member

Hi there, feel free! If you submit a PR I'll look it over and we can go from there.

Member

rcurtin commented Dec 12, 2016

Hi there, feel free! If you submit a PR I'll look it over and we can go from there.

@MikeLing

This comment has been minimized.

Show comment
Hide comment
@MikeLing

MikeLing Dec 13, 2016

Contributor

@rcurtin Hey, How could I just run discrete_distribution.cpp to test my pr and how could I use gdb or other debug tool about it? Thank you very much

Contributor

MikeLing commented Dec 13, 2016

@rcurtin Hey, How could I just run discrete_distribution.cpp to test my pr and how could I use gdb or other debug tool about it? Thank you very much

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Dec 13, 2016

Member

If you mean that you want to run the discrete distribution tests, build the mlpack_test target and run the test suite:

$ bin/mlpack_test -t DiscreteDistributionTest

and the sources for that test are in src/mlpack/tests/discrete_distribution_test.cpp.

Member

rcurtin commented Dec 13, 2016

If you mean that you want to run the discrete distribution tests, build the mlpack_test target and run the test suite:

$ bin/mlpack_test -t DiscreteDistributionTest

and the sources for that test are in src/mlpack/tests/discrete_distribution_test.cpp.

@MikeLing

This comment has been minimized.

Show comment
Hide comment
@MikeLing

MikeLing Dec 13, 2016

Contributor

@rcurtin It said Test setup error: no test cases matching filter or all test cases were disabled

MacBook-Pro:build mikeling$ bin/mlpack_test -t DiscreteDistributionTest
Test setup error: no test cases matching filter or all test cases were disabled

How could I use gdb to test the special test like DiscreteDistributionTest? Because I want to get familiar with how exactly the discrete distribution works inside, so I want to debug the test case step by step :)

Contributor

MikeLing commented Dec 13, 2016

@rcurtin It said Test setup error: no test cases matching filter or all test cases were disabled

MacBook-Pro:build mikeling$ bin/mlpack_test -t DiscreteDistributionTest
Test setup error: no test cases matching filter or all test cases were disabled

How could I use gdb to test the special test like DiscreteDistributionTest? Because I want to get familiar with how exactly the discrete distribution works inside, so I want to debug the test case step by step :)

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Dec 13, 2016

Member

Oh, sorry, I gave the wrong instructions. The test suite is actually called DistributionTest not DiscreteDistributionTest, and the tests are found in distribution_test.cpp. Take a look and you'll see what the names are.

So you could do something like, e.g.,

(gdb) break distribution_test.cpp:35
(gdb) run -t DistributionTest/DiscreteDistributionConstructorTest

You can see that I can also specify the name of the individual test to run, as well as the test suite. So you can use this strategy to see how it is working.

Member

rcurtin commented Dec 13, 2016

Oh, sorry, I gave the wrong instructions. The test suite is actually called DistributionTest not DiscreteDistributionTest, and the tests are found in distribution_test.cpp. Take a look and you'll see what the names are.

So you could do something like, e.g.,

(gdb) break distribution_test.cpp:35
(gdb) run -t DistributionTest/DiscreteDistributionConstructorTest

You can see that I can also specify the name of the individual test to run, as well as the test suite. So you can use this strategy to see how it is working.

@MikeLing

This comment has been minimized.

Show comment
Hide comment
@MikeLing

MikeLing Dec 15, 2016

Contributor

Hey @rcurtin , I just create a PR[1] for this issue. I'm not sure if that's your need, but some code will be a good start I guess. And I will add comments if PR close to be merged :)

[1] #830

Contributor

MikeLing commented Dec 15, 2016

Hey @rcurtin , I just create a PR[1] for this issue. I'm not sure if that's your need, but some code will be a good start I guess. And I will add comments if PR close to be merged :)

[1] #830

@Lakshya1605

This comment has been minimized.

Show comment
Hide comment
@Lakshya1605

Lakshya1605 Dec 28, 2016

Contributor

Is this still open ,if yes i would like to work on it .It may take some time i am new here.Thank You

Contributor

Lakshya1605 commented Dec 28, 2016

Is this still open ,if yes i would like to work on it .It may take some time i am new here.Thank You

@MikeLing

This comment has been minimized.

Show comment
Hide comment
@MikeLing

MikeLing Dec 29, 2016

Contributor

Hey @Lakshya1605, I'm working on it already. And I'm sure it's close to be done :)

Contributor

MikeLing commented Dec 29, 2016

Hey @Lakshya1605, I'm working on it already. And I'm sure it's close to be done :)

@dineshraj01

This comment has been minimized.

Show comment
Hide comment
@dineshraj01

dineshraj01 Jan 19, 2017

Contributor

Hi, has this issue been resolved? I would like to work on it.

Contributor

dineshraj01 commented Jan 19, 2017

Hi, has this issue been resolved? I would like to work on it.

@MikeLing

This comment has been minimized.

Show comment
Hide comment
@MikeLing

MikeLing Jan 23, 2017

Contributor

@dineshraj01 Sorry for the late reply, I meet some problems on hmm but I'm trying to resolve it. Could you wait a bit long? I will hand out this issue if I'm sure I can't finished it. Thank you :)

Contributor

MikeLing commented Jan 23, 2017

@dineshraj01 Sorry for the late reply, I meet some problems on hmm but I'm trying to resolve it. Could you wait a bit long? I will hand out this issue if I'm sure I can't finished it. Thank you :)

@rcurtin

This comment has been minimized.

Show comment
Hide comment
@rcurtin

rcurtin Feb 27, 2017

Member

Fixed with #830.

Member

rcurtin commented Feb 27, 2017

Fixed with #830.

@rcurtin rcurtin closed this Feb 27, 2017

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