Skip to content

Commit

Permalink
Merge pull request #351 from jasondavies/typos
Browse files Browse the repository at this point in the history
Fix typos in notebooks
  • Loading branch information
gileshd committed Feb 24, 2024
2 parents 08d1381 + 5df742a commit 493142e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"\n",
"This is a generalized Gaussian SSM, where the observation model is non-Gaussian.\n",
"\n",
"To perform approximate inferece, using the conditional moments Gaussian filter (CMGF).\n",
"To perform approximate inference, using the conditional moments Gaussian filter (CMGF).\n",
"We approximate the relevant integrals using 3 different methods: linearization (extended Kalman filter),\n",
"sigma point approximation (unscented kalman filter), and Gauss hermite integration (order 5).\n",
"We compare results with the offline (batch) Laplace approximation, and see that GHKF converges fastest to the batch solution,\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"\n",
"This is a generalized Gaussian SSM, where the observation model is non-linear and non-Gaussian.\n",
"\n",
"To perform approximate inferece, using the conditional moments Gaussian filter (CMGF).\n",
"To perform approximate inference, using the conditional moments Gaussian filter (CMGF).\n",
"We approximate the relevant integrals using the extended Kalman filter.\n",
"For more details, see sec 8.7.7 of [Probabilistic Machine Learning: Advanced Topics](https://probml.github.io/pml-book/book2.html).\n",
"\n",
Expand Down Expand Up @@ -395,7 +395,7 @@
},
"outputs": [],
"source": [
"# Some model parameters and helper funciton\n",
"# Some model parameters and helper function\n",
"state_dim, emission_dim = flat_params.size, output_dim\n",
"sigmoid_fn = lambda w, x: jax.nn.sigmoid(apply_fn(w, x))\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"source": [
"# Fitting an LDS with Poisson Likelihood using conditional moments Gaussian filter\n",
"\n",
"Adapted fom [https://github.com/lindermanlab/ssm-jax/blob/main/notebooks/poisson-lds-example.ipynb](https://github.com/lindermanlab/ssm-jax/blob/main/notebooks/poisson-lds-example.ipynb )"
"Adapted from [https://github.com/lindermanlab/ssm-jax/blob/main/notebooks/poisson-lds-example.ipynb](https://github.com/lindermanlab/ssm-jax/blob/main/notebooks/poisson-lds-example.ipynb )"
]
},
{
Expand Down Expand Up @@ -221,7 +221,7 @@
"id": "0DV-H8hRYJbK"
},
"source": [
"First, we define a helper random rotation functionto use as our dynamics function."
"First, we define a helper random rotation function to use as our dynamics function."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/hmm/gaussian_hmm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
"\n",
"This function fits the data into _folds_ where each fold consists of all\n",
"but one of the training sequences. It fits the model to each fold in \n",
"parallel, and then computs the log likelihood of the held-out sequence for\n",
"parallel, and then computes the log likelihood of the held-out sequence for\n",
"each fold. The average held-out log likelihood is what we will use for \n",
"determining the number of discrete states."
]
Expand Down Expand Up @@ -312,7 +312,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Plot the individual and average validation log likelihods as a function of number of states"
"### Plot the individual and average validation log likelihoods as a function of number of states"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/linear_gaussian_ssm/kf_linreg.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Offline inferenece\n",
"## Offline inference\n",
"\n",
"We compute the offline posterior given all the data using Bayes rule for linear regression.\n",
"This should give the same results as the final step of online inference."
Expand Down
8 changes: 4 additions & 4 deletions docs/notebooks/linear_gaussian_ssm/lgssm_hmc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"source": [
"\n",
"\n",
"# Initilize parameters by fitting EM algorithm\n",
"# Initialize parameters by fitting EM algorithm\n",
"num_iters = 100\n",
"test_model = LinearGaussianSSM(state_dim, emission_dim)\n",
"initial_params, param_props = test_model.initialize(next(keys))\n",
Expand Down Expand Up @@ -539,7 +539,7 @@
"source": [
"## Use HMC to infer posterior over a subset of the parameters\n",
"\n",
"We freeze the transition parameters and inital parameters, so that only covariance matrices are learned.\n",
"We freeze the transition parameters and initial parameters, so that only covariance matrices are learned.\n",
"This is useful for structural time series models (see e.g., [sts-jax](https://github.com/probml/sts-jax) library, \n",
"which builds on dynamax.).\n"
]
Expand All @@ -550,7 +550,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Freeze transition parameters and inital parameters, so that only covariance matrices are learned\n",
"# Freeze transition parameters and initial parameters, so that only covariance matrices are learned\n",
"\n",
"test_model = LinearGaussianSSM(state_dim, emission_dim)\n",
"test_params, test_param_props = test_model.initialize(next(keys),\n",
Expand All @@ -559,7 +559,7 @@
" emission_weights=true_params.emissions.weights,\n",
" emission_bias=true_params.emissions.bias)\n",
"\n",
"# Set transition parameters and inital parameters to true values and mark as frozen\n",
"# Set transition parameters and initial parameters to true values and mark as frozen\n",
"test_param_props.dynamics.weights.trainable = False\n",
"test_param_props.dynamics.bias.trainable = False\n",
"test_param_props.emissions.weights.trainable = False\n",
Expand Down

0 comments on commit 493142e

Please sign in to comment.