Skip to content

Commit

Permalink
minor changes to default values
Browse files Browse the repository at this point in the history
  • Loading branch information
chyalexcheng committed Jan 16, 2024
1 parent 7df6424 commit b5f872e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions grainlearning/dynamic_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __init__(
#### Uncertainty ####

self.sigma_min = 1.0e-6

self.sigma_max = sigma_max

self.sigma_tol = sigma_tol
Expand Down Expand Up @@ -383,7 +383,7 @@ class IODynamicSystem(DynamicSystem):
:param inv_obs_weight: Inverse of the observation weight, defaults to None, optional
:param param_data: Parameter data, defaults to None, optional
:param sim_data: Simulation data, defaults to None, optional
:param sim_data_files: List pf simulation data files (num_samples), defaults to None, optional
:param sim_data_files: List of simulation data files (num_samples), defaults to None, optional
"""

def __init__(
Expand Down Expand Up @@ -428,7 +428,7 @@ def __init__(
param_names
)
# TODO: reuse initialization from base class

##### Parameters #####

self.num_params = len(param_names)
Expand Down
2 changes: 0 additions & 2 deletions grainlearning/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def __init__(

self.ess = None



@classmethod
def from_dict(cls: Type["SMC"], obj: dict):
"""Initialize the class using a dictionary style
Expand Down
8 changes: 4 additions & 4 deletions grainlearning/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,22 @@ class GaussianMixtureModel:

def __init__(
self,
max_num_components=0,
weight_concentration_prior: float = 0.2,
max_num_components = 0,
weight_concentration_prior: float = 0.0,
covariance_type: str = "tied",
n_init: int = 1,
tol: float = 1.0e-5,
max_iter: int = 100,
random_state: int = None,
init_params: str = "kmeans",
init_params: str = "k-means++",
warm_start: bool = False,
expand_factor: int = 10,
slice_sampling: bool = False,
):
""" Initialize the Gaussian Mixture Model class"""
self.max_num_components = max_num_components

if weight_concentration_prior is None:
if not weight_concentration_prior:
self.weight_concentration_prior = 1.0 / max_num_components
else:
self.weight_concentration_prior = weight_concentration_prior
Expand Down

0 comments on commit b5f872e

Please sign in to comment.