Skip to content

Commit

Permalink
Merge pull request #191 from Limmen/dev1
Browse files Browse the repository at this point in the history
gp_conditional.py
  • Loading branch information
Limmen authored Aug 15, 2023
2 parents a98338f + 294a2c3 commit 583a7ae
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List, Dict, Any, Union
import gpytorch
import numpy as np
from numpy.typing import NDArray
import torch
from csle_system_identification.gp.gp_regression_model_with_gauissan_noise import GPRegressionModelWithGaussianNoise
from csle_base.json_serializable import JSONSerializable
Expand Down Expand Up @@ -33,7 +34,7 @@ def __init__(self, conditional_name: str, metric_name: str,
self.observed_y = observed_y
self.scale_parameter = scale_parameter
self.noise_parameter = noise_parameter
self.distribution = []
self.distribution: List[NDArray[Any]] = []

@staticmethod
def from_dict(d: Dict[str, Any]) -> "GPConditional":
Expand All @@ -53,7 +54,7 @@ def to_dict(self) -> Dict[str, Any]:
"""
:return: a dict representation of the DTO
"""
d = {}
d: Dict[str, Any] = {}
d["conditional_name"] = self.conditional_name
d["metric_name"] = self.metric_name
d["sample_space"] = self.sample_space
Expand Down Expand Up @@ -95,7 +96,7 @@ def generate_distribution(self) -> None:
self.sample_space.sort()
self.distribution = list(self.generate_distributions_for_samples(samples=self.sample_space).tolist())

def generate_distributions_for_samples(self, samples) -> np.ndarray:
def generate_distributions_for_samples(self, samples) -> NDArray[Any]:
"""
Generates distributions for a given sample
Expand Down

0 comments on commit 583a7ae

Please sign in to comment.