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

May 19 Meeting #377

Open
4 of 5 tasks
smattis opened this issue May 20, 2020 · 9 comments
Open
4 of 5 tasks

May 19 Meeting #377

smattis opened this issue May 20, 2020 · 9 comments

Comments

@smattis
Copy link
Contributor

smattis commented May 20, 2020

  • Change compareP default for normalize to False
  • Change output_probability_set to observed_output_set
  • Fix computation of number of clusters.
  • Change dataConsistent to calculateR
  • Do rejection sampling before fitting for rv (possibly do later).
This was referenced May 20, 2020
@eecsu
Copy link
Contributor

eecsu commented May 29, 2020

Some notes on examples running the v3-dev branch of BET. Will create a separate example discussing documentation.

First, some general notes:

  • I think we should rename files in the examples that are the actual ones running BET. Several of the example directories have multiple files, but the user should only be running one or two of them. I am thinking appending files with a BET_ as a way to indicate this is the file a user should run. This probably changes the documentation a bit as well.
  • I am curious what your thoughts are on creating separate sub-directories within examples for better organization and clarity. Since we are going to continue to develop new solution methodologies (e.g., the optimal weighted CDF approach that I am currently working on), it seems like we should separate the examples into the solution method. Right now, I think we would have these directories within examples: "measure_methods" (the original method), "density_methods" (what we are doing now), "optimal_experimental_designs" (this is a re-naming of the sensitivity example directory), and then "data_sets_for_examples" to put the files in the matfiles directory currently within the examples directory that does not actually have any example in it. Eventually, "cdf_methods" would be added. I think this will be helpful for users (and also us) in separating out more clearly which examples are doing what so that they are also easier to find. I understand that if one wants to compare methods, then this is not the best. But, generally, I think people are going to want to do play around with one method and can move files around to compare if they need to.

Now, some specific notes/issues.

  • The compare_rv.py example fails. Looks like this will fix it:
    import bet.postProcess.compareP as compP

  • I didn't run the FEniCS examples because I setup a different conda environment for this version of BET and didn't install FEniCS. Still need to check this, but low priority, so will consider that one "passed" for now. We may just want to have a version of this example that is like the

  • The plotDomains3D.py example spits out the following UserWarning:

The following kwargs were not used by contour: 'triangles'
s)

So, it looks like a plot function needs updating.

  • Change maxiter=1000 to maxiter=100 in the quadrature calls of linearMapDataConsistent.py to make it run faster. Also change the comment of the line

invert_to = 'expon' # 'multivariate_gaussian', 'expon', 'beta'

to

invert_to = 'expon' # 'multivariate_gaussian', 'expon', 'beta', or 'kde'.

  • nonlinearMapDataConsistent.py. The data space is 2-D not 3-D (see comment on line 54). Also, change the maxiter to 100 in the quadrature calls as in the linearMap example above to speed up. In the myModel.py file, change the default spatial point values for the 2D case to be (0.1,0.05) and (0.05,0.1). These give very good results (compared to other points), and it is good for someone to think about why that is.

  • nonlinearMapUniformSampling.py gives same plot warning as plotDomains3d.py mentioned above.

  • this is a note about LUQ, but is based on running the selkov.py example. I think we should have some sort of "verbose" flag option for running LUQ that generates all the outputs we currently see. This is useful when we are debugging and testing things out. If it is not set, then the knot output info associated with the optimal splines should be logged but not printed (maybe just print out to screen every 10th or 100th spline that is completed so the user knows there is progress)

  • In the selkov.py example, the following error occurs:

Multivariate Gaussian
Traceback (most recent call last):
File "selkov.py", line 63, in
calculateR.invert_to_multivariate_gaussian(disc1)
File "/home/tbutler/anaconda3/envs/BET-v3-dev/lib/python3.7/site-packages/bet-3.0.0-py3.7.egg/bet/calculateP/calculateR.py", line 298, in invert_to_multivariate_gaussian
File "/home/tbutler/anaconda3/envs/BET-v3-dev/lib/python3.7/site-packages/bet-3.0.0-py3.7.egg/bet/calculateP/calculateR.py", line 119, in invert
ValueError: setting an array element with a sequence.

  • In the selkov.py example. Also reduce the maxiter for the quadratures to 100 to make it run faster (even though it did not run past the above error).

@eecsu
Copy link
Contributor

eecsu commented May 29, 2020

This is about documentation.

  • Running make html gives the following error

Theme error:
sphinx_rtd_theme is no longer a hard dependency since version 1.4.0. Please install it manually.(pip install sphinx_rtd_theme)
Makefile:45: recipe for target 'html' failed
make: *** [html] Error 2

Of course, running the pip command it asks for fixes this, but maybe we should use a theme that is standard for sphinx?

  • A quick skim of the documentation looks okay. There are a few weird things here and there, but nothing worth stopping the merge as far as I can tell. It is probably a good idea for me to go through and clean up some of the documentation to re-familiarize myself with the old functions as well as looking at the details of the new functions for creating more examples. This will also help with writing some tutorials as well.

@smattis
Copy link
Contributor Author

smattis commented Jun 1, 2020

The plotDomains3D.py example spits out the following UserWarning...

This warning is highly sensitive to your matplotlib version number. It doesn't seem to affect the output at all if triangles is set with newer versions, but with older ones it is required. I think we should keep it to be safe.

@smattis
Copy link
Contributor Author

smattis commented Jun 1, 2020

nonlinearMapUniformSampling.py gives same plot warning as plotDomains3d.py mentioned above.

Same as above.

@smattis
Copy link
Contributor Author

smattis commented Jun 1, 2020

Running make html gives the following error

The rtd (Read the Docs) theme is very standard. I think they removed all of the themes from the sphinx build because of the overhead of having like 30 themes.

@mathematicalmichael
Copy link
Collaborator

The plotDomains3D.py example spits out the following UserWarning...

This warning is highly sensitive to your matplotlib version number. It doesn't seem to affect the output at all if triangles is set with newer versions, but with older ones it is required. I think we should keep it to be safe.

@eecsu just a reminder that pip install . will enforce version dependencies in ways that python setup.py install will not.

@eecsu
Copy link
Contributor

eecsu commented Jun 1, 2020

I have matlpotlib version 3.0.2, which is pretty new.

I am wondering if the tricontourf calls in plotDomains.py where this occurs in the show_data_domain_2D function is causing this because the keyword argument occurs out of order? Basically, x and y data should be the first two arguments, which they are, but then the triangles argument is supposed to be the third argument from what I can tell in the documentation dating back to several versions of matplotlib. We pass an array of zeros, which I think it interprets as the "Z" values that are not keyworded, but are supposed to occur after the triangles argument according to the documentation. If it first sees x and y data, but not triangles, then it actually calls the triangulation function, which is not efficient since we call it outside of this plot function.

It appears to me that changing the tricontourf call to this:

plt.tricontourf(data_obj.get_values()[:, 0], data_obj.get_values()[:, 1], triangles, np.zeros((data_obj.get_values().shape[0],)), colors='grey')

will remove this warning by placing the triangles object in the right location of the plot call. I think this should work for all versions of matplotlib.

@smattis
Copy link
Contributor Author

smattis commented Jun 2, 2020

Running make html gives the following error

I added extra information in the Readme

@smattis
Copy link
Contributor Author

smattis commented Jun 2, 2020

this is a note about LUQ, but is based on running the selkov.py example. I think we should have some sort of "verbose" flag option for running LUQ that generates all the outputs we currently see. This is useful when we are debugging and testing things out. If it is not set, then the knot output info associated with the optimal splines should be logged but not printed (maybe just print out to screen every 10th or 100th spline that is completed so the user knows there is progress)

See CU-Denver-UQ/LUQ#6

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 a pull request may close this issue.

3 participants