jliszka / probability-monad

Apache License 2.0
263 stars 38 forks source link

update to the latest code/documentation #10

Closed kailuowang closed 8 years ago

kailuowang commented 9 years ago

I love your library. Noticed that you(maybe someone else) published the 1.0.0 version of it to bintray jcenter. Is that you? if so, do you mind update code (since package name is org.jliszka.probabilitymonad on that version) the documentation here? If it's not you, I can update the code together with a sbt-bintray plugin and create a PR. Thanks!

kailuowang commented 9 years ago

didn't see that in the other issue you published it last year to sonatype. Do you still want the PR?

jliszka commented 9 years ago

Thanks!

Yeah, I published it to sonatype. I think maybe bintray mirrors or pulls from sonatype? I'm not sure how it works. Is there still a package name mismatch somewhere?

kailuowang commented 9 years ago

It's all good. It will be nice it is indicated in the readme that it's available on sonatype and jcenter throught "org.jliszka" %% "probability-monad" % "1.0.0"

jliszka commented 9 years ago

Cool. I'll add that to the README. Good suggestion :)

On Fri, Jul 31, 2015 at 4:08 PM, Kailuo Wang notifications@github.com wrote:

It's all good. It will be nice it is indicated in the readme that it's available on sonatype and jcenter throught "org.jliszka" %% "probability-monad" % "1.0.0"

— Reply to this email directly or view it on GitHub https://github.com/jliszka/probability-monad/issues/10#issuecomment-126801524 .

cristipp commented 9 years ago

I love this library as well, thanks for taking the time to publish it. We use it, but hit a bit of a snag. The alias function in discrete[A] at https://github.com/jliszka/probability-monad/blob/master/src/main/scala/probability-monad/Distribution.scala#L286 has a bug in the published version. The bug has been fixed in master, but the published version was not updated. Would there be a 1.0.1 version soon?

Here's what I see in .ivy2/cache/org.jliszka/probability-monad_2.11/srcs/probability-monad_2.11-1.0.0-sources.jar :

277     // The alias method: http://www.keithschwarz.com/darts-dice-coins/
    278     private def alias(smaller: List[(A, Double)], bigger: List[(A, Double)]): List[(A, Double, Option[A])] = {
    279       smaller match {
    280         case Nil => bigger.map{ case (a, _) => (a, 1.0, None) }
    281         case (s, sp)::ss => {
    282           val (b, pb)::bb = bigger
    283           val remainder = (b, pb - (1.0 - sp))
    284           val rest = if (remainder._2 < 0.9999) alias(remainder :: ss, bb) else alias(ss, remainder :: bb)
    285           (s, sp, Some(b)) :: rest
    286         }
    287       }
    288     }

Thank you!

jliszka commented 9 years ago

Ah, thanks! Just published the latest master as 1.0.1.

Glad you're finding use for it!

On Thu, Aug 20, 2015 at 6:45 PM, Cristian Petrescu-Prahova < notifications@github.com> wrote:

I love this library as well, thanks for taking the time to publish it. We use it, but hit a bit of a snag. The alias function in discrete[A] at https://github.com/jliszka/probability-monad/blob/master/src/main/scala/probability-monad/Distribution.scala#L286 has a bug in the published version. The bug has been fixed in master, but the published version was not updated. Would there be a 1.0.1 version soon?

Here's what I see in .ivy2/cache/org.jliszka/probability-monad_2.11/srcs/probability-monad_2.11-1.0.0-sources.jar :

277 // The alias method: http://www.keithschwarz.com/darts-dice-coins/ 278 private def alias(smaller: List[(A, Double)], bigger: List[(A, Double)]): List[(A, Double, Option[A])] = { 279 smaller match { 280 case Nil => bigger.map{ case (a, _) => (a, 1.0, None) } 281 case (s, sp)::ss => { 282 val (b, pb)::bb = bigger 283 val remainder = (b, pb - (1.0 - sp)) 284 val rest = if (remainder._2 < 0.9999) alias(remainder :: ss, bb) else alias(ss, remainder :: bb) 285 (s, sp, Some(b)) :: rest 286 } 287 } 288 }

Thank you!

— Reply to this email directly or view it on GitHub https://github.com/jliszka/probability-monad/issues/10#issuecomment-133204581 .

cristipp commented 9 years ago

Thanks for the quick response. Awesome library for working with probability distributions.

On Thu, Aug 20, 2015 at 8:31 PM, Jason Liszka notifications@github.com wrote:

Ah, thanks! Just published the latest master as 1.0.1.

Glad you're finding use for it!

On Thu, Aug 20, 2015 at 6:45 PM, Cristian Petrescu-Prahova < notifications@github.com> wrote:

I love this library as well, thanks for taking the time to publish it. We use it, but hit a bit of a snag. The alias function in discrete[A] at

https://github.com/jliszka/probability-monad/blob/master/src/main/scala/probability-monad/Distribution.scala#L286 has a bug in the published version. The bug has been fixed in master, but the published version was not updated. Would there be a 1.0.1 version soon?

Here's what I see in

.ivy2/cache/org.jliszka/probability-monad_2.11/srcs/probability-monad_2.11-1.0.0-sources.jar :

277 // The alias method: http://www.keithschwarz.com/darts-dice-coins/ 278 private def alias(smaller: List[(A, Double)], bigger: List[(A, Double)]): List[(A, Double, Option[A])] = { 279 smaller match { 280 case Nil => bigger.map{ case (a, _) => (a, 1.0, None) } 281 case (s, sp)::ss => { 282 val (b, pb)::bb = bigger 283 val remainder = (b, pb - (1.0 - sp)) 284 val rest = if (remainder._2 < 0.9999) alias(remainder :: ss, bb) else alias(ss, remainder :: bb) 285 (s, sp, Some(b)) :: rest 286 } 287 } 288 }

Thank you!

— Reply to this email directly or view it on GitHub < https://github.com/jliszka/probability-monad/issues/10#issuecomment-133204581

.

— Reply to this email directly or view it on GitHub https://github.com/jliszka/probability-monad/issues/10#issuecomment-133267797 .

jliszka commented 9 years ago

:) What do you use it for, out of curiosity?

On Fri, Aug 21, 2015 at 1:25 PM, Cristian Petrescu-Prahova < notifications@github.com> wrote:

Thanks for the quick response. Awesome library for working with probability distributions.

On Thu, Aug 20, 2015 at 8:31 PM, Jason Liszka notifications@github.com wrote:

Ah, thanks! Just published the latest master as 1.0.1.

Glad you're finding use for it!

On Thu, Aug 20, 2015 at 6:45 PM, Cristian Petrescu-Prahova < notifications@github.com> wrote:

I love this library as well, thanks for taking the time to publish it. We use it, but hit a bit of a snag. The alias function in discrete[A] at

https://github.com/jliszka/probability-monad/blob/master/src/main/scala/probability-monad/Distribution.scala#L286

has a bug in the published version. The bug has been fixed in master, but the published version was not updated. Would there be a 1.0.1 version soon?

Here's what I see in

.ivy2/cache/org.jliszka/probability-monad_2.11/srcs/probability-monad_2.11-1.0.0-sources.jar

:

277 // The alias method: http://www.keithschwarz.com/darts-dice-coins/ 278 private def alias(smaller: List[(A, Double)], bigger: List[(A, Double)]): List[(A, Double, Option[A])] = { 279 smaller match { 280 case Nil => bigger.map{ case (a, _) => (a, 1.0, None) } 281 case (s, sp)::ss => { 282 val (b, pb)::bb = bigger 283 val remainder = (b, pb - (1.0 - sp)) 284 val rest = if (remainder._2 < 0.9999) alias(remainder :: ss, bb) else alias(ss, remainder :: bb) 285 (s, sp, Some(b)) :: rest 286 } 287 } 288 }

Thank you!

— Reply to this email directly or view it on GitHub <

https://github.com/jliszka/probability-monad/issues/10#issuecomment-133204581

.

— Reply to this email directly or view it on GitHub < https://github.com/jliszka/probability-monad/issues/10#issuecomment-133267797

.

— Reply to this email directly or view it on GitHub https://github.com/jliszka/probability-monad/issues/10#issuecomment-133503963 .

cristipp commented 9 years ago

Just scratching the surface: sample a probability distribution given a set of frequency counts. Which we use to build a language model of sorts. I wish I had more time to explore the compositional aspects :)

On Fri, Aug 21, 2015 at 10:40 AM, Jason Liszka notifications@github.com wrote:

:) What do you use it for, out of curiosity?

On Fri, Aug 21, 2015 at 1:25 PM, Cristian Petrescu-Prahova <

notifications@github.com> wrote:

Thanks for the quick response. Awesome library for working with probability distributions.

On Thu, Aug 20, 2015 at 8:31 PM, Jason Liszka notifications@github.com wrote:

Ah, thanks! Just published the latest master as 1.0.1.

Glad you're finding use for it!

On Thu, Aug 20, 2015 at 6:45 PM, Cristian Petrescu-Prahova < notifications@github.com> wrote:

I love this library as well, thanks for taking the time to publish it. We use it, but hit a bit of a snag. The alias function in discrete[A] at

https://github.com/jliszka/probability-monad/blob/master/src/main/scala/probability-monad/Distribution.scala#L286

has a bug in the published version. The bug has been fixed in master, but the published version was not updated. Would there be a 1.0.1 version soon?

Here's what I see in

.ivy2/cache/org.jliszka/probability-monad_2.11/srcs/probability-monad_2.11-1.0.0-sources.jar

:

277 // The alias method: http://www.keithschwarz.com/darts-dice-coins/ 278 private def alias(smaller: List[(A, Double)], bigger: List[(A, Double)]): List[(A, Double, Option[A])] = { 279 smaller match { 280 case Nil => bigger.map{ case (a, _) => (a, 1.0, None) } 281 case (s, sp)::ss => { 282 val (b, pb)::bb = bigger 283 val remainder = (b, pb - (1.0 - sp)) 284 val rest = if (remainder._2 < 0.9999) alias(remainder :: ss, bb) else alias(ss, remainder :: bb) 285 (s, sp, Some(b)) :: rest 286 } 287 } 288 }

Thank you!

— Reply to this email directly or view it on GitHub <

https://github.com/jliszka/probability-monad/issues/10#issuecomment-133204581

.

— Reply to this email directly or view it on GitHub <

https://github.com/jliszka/probability-monad/issues/10#issuecomment-133267797

.

— Reply to this email directly or view it on GitHub < https://github.com/jliszka/probability-monad/issues/10#issuecomment-133503963

.

— Reply to this email directly or view it on GitHub https://github.com/jliszka/probability-monad/issues/10#issuecomment-133506942 .