Skip to content
Discussion options

You must be logged in to vote

I don't quite follow your full code example, but I think the way to do a "soft" version of your snippet:

if fPoints >= dPoints:
  balance += fOdds*1000

would be something like this:

import jax.nn
balance += fOdds * 1000 * jax.nn.sigmoid(fPoints - dPoints)

This uses the Sigmoid function in place of your (implied) step function, so that if fPoints is much smaller than dPoints, the resulting operation is balance += 0, and if fPoints is much larger than dPoints, the resulting operation is balance += fOdds * 1000, and the output varies smoothly between these two extremes.

The recommendation for softmax in the docs you linked to is as a replacement for argmax, which your code doesn't use, so so…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@velkyvont
Comment options

@jakevdp
Comment options

Answer selected by velkyvont
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants