Skip to content
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

Merged
merged 13 commits into from
Jul 16, 2016
Merged

Hyperparamopt #58

merged 13 commits into from
Jul 16, 2016

Conversation

narayanan2004
Copy link
Contributor

No description provided.

@buildbot-princeton
Copy link
Collaborator

Can one of the admins verify this patch?

1 similar comment
@buildbot-princeton
Copy link
Collaborator

Can one of the admins verify this patch?

@mihaic
Copy link
Member

mihaic commented Jul 12, 2016

OK to test.

# limitations under the License.
"""Metropolis-Hasting Random number generator

This implementation provides random samples from a user-given
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

logger = logging.getLogger(__name__)


def get_sigma(x, minlimit=-np.inf, maxlimit=np.inf):
Copy link
Contributor

Choose a reason for hiding this comment

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

min_limit, max_limit

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

xt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to x

@mihaic
Copy link
Member

mihaic commented Jul 14, 2016

Please add examples/hyperparamopt/requirements.txt containing everything required for running the examples, but not in install_requires in setup.py.


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.
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@xoltar
Copy link
Contributor

xoltar commented Jul 16, 2016

👍

@mihaic mihaic merged commit c455828 into brainiak:master Jul 16, 2016
@narayanan2004 narayanan2004 deleted the hyperparamopt branch July 16, 2016 00:45
danielsuo pushed a commit that referenced this pull request Nov 16, 2017
implement serialization using numbuf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants