This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A collection of helper functions for optimization with JAX. | |
UPDATE: This is obsolete now that `jax.scipy.optimize.minimize` is exists! | |
""" | |
import numpy as onp | |
import scipy.optimize | |
from jax import grad, jit | |
from jax.tree_util import tree_flatten, tree_unflatten | |
from jax.flatten_util import ravel_pytree |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from pylds.models import DefaultLDS | |
inputs = \ | |
np.array([[ 0. , 0. ], | |
[ 2.72785283, 7.53608657], | |
[ 0. , 7.23201033], | |
[ 2.0261219 , 7.07866193], | |
[ 2.42989525, 7.67644583], |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from builtins import range | |
import numpy as np | |
np.seterr(divide='ignore') # these warnings are usually harmless for this code | |
np.random.seed(0) | |
from matplotlib import pyplot as plt | |
import matplotlib | |
import os | |
matplotlib.rcParams['font.size'] = 8 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from hips.plotting.layout import create_figure, create_axis_at_location | |
from hips.plotting.colormaps import gradient_cmap | |
import seaborn as sns | |
color_names = ["windows blue", | |
"amber", | |
"crimson", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple demo showing weird marginal likelihood estimates | |
# for GP classification when using EP inference. | |
import numpy as np | |
np.random.seed(0) | |
import matplotlib.pyplot as plt | |
import GPy | |
from GPy.kern import RBF | |
# Model parameters |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import numpy as np | |
np.seterr(divide='ignore') # these warnings are usually harmless for this code | |
from matplotlib import pyplot as plt | |
import matplotlib | |
import os | |
matplotlib.rcParams['font.size'] = 8 | |
import pyhsmm | |
from pyhsmm.util.text import progprint_xrange |