-
Notifications
You must be signed in to change notification settings - Fork 137
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
Hyperparamopt #58
Hyperparamopt #58
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
OK to test. |
# limitations under the License. | ||
"""Metropolis-Hasting Random number generator | ||
|
||
This implementation provides random samples from a user-given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this MCMC different or better than other MCMC implementations for Python? May want to explain here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked for other python packages that do what I want i.e generate samples from a user-specified pdf. I couldn't find any, so had to write my own. If you know of any other implementation, please let me know as I am not aware of any at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about pymc
?
https://pypi.python.org/pypi/pymc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe http://dan.iel.fm/emcee/current/ . It's OK if neither of these does what you need, you can just say that (and why) in the comments so people know there's a reason for having an MCMC module in brainiak rather than using an existing library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still and MCMC module should be outside this package, maybe in utils or some other package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some searching, I see that I only need samples from a 1D Gaussian mixture model. I have changed the code to do this using other simpler methods in numpy+scipy. I will remove this file (mcmc.py) and the corresponding tests.
…d cython; all scipy.stats continuous distributions supported; more comments added
logger = logging.getLogger(__name__) | ||
|
||
|
||
def get_sigma(x, minlimit=-np.inf, maxlimit=np.inf): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min_limit, max_limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Arguments | ||
--------- | ||
|
||
x : scalar (or) 1D array of reals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to x
Please add |
|
||
def get_sigma(x, min_limit=-np.inf, max_limit=np.inf): | ||
"""Computes the standard deviations around the points for a 1D | ||
Gaussian mixture model computation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put a one-line summary in each docstring. Also, something we have been nitpicking in previous PRs, function summaries should be phrased as commands, not descriptions. In this case, "Compute" instead of "Computes".
https://www.python.org/dev/peps/pep-0257/#one-line-docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
👍 |
implement serialization using numbuf
No description provided.