Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jjau committed Apr 22, 2024
1 parent d09bc58 commit 3548eec
Show file tree
Hide file tree
Showing 8 changed files with 5,400 additions and 5,442 deletions.
10,102 changes: 5,101 additions & 5,001 deletions python/model.csv

Large diffs are not rendered by default.

130 changes: 65 additions & 65 deletions python/new_sim.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions python/palin/internal_noise/double_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from ..simulation.double_pass_experiment import DoublePassExperiment
from ..simulation.trial import Int2Trial, Int1Trial
from ..simulation.linear_observer import LinearObserver
from ..simulation.double_pass_statistics import DoublePassStatistics
from ..simulation import double_pass_statistics as dps
from ..simulation.simulation import Simulation as Sim


Expand Down Expand Up @@ -149,12 +149,12 @@ def build_model(cls,internal_noise_range=np.arange(0,5,.1),criteria_range=np.ara

sim = Sim(DoublePassExperiment, experiment_params,
LinearObserver, observer_params,
DoublePassStatistics, analyser_params)
dps.DoublePassStatistics, analyser_params)

sim_df = sim.run_all(n_runs=n_runs, verbose=True)

# average measures over all runs
sim_df.groupby(['internal_noise_std','criteria'])[DoublePassStatistics.get_metric_names()].mean()
sim_df.groupby(['internal_noise_std','criteria'])[dps.DoublePassStatistics.get_metric_names()].mean()
return sim_df


4 changes: 2 additions & 2 deletions python/palin/internal_noise/internal_noise_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def extract_single_internal_noise(cls,data_df, trial_id = 'trial_id', feature_id
raise NotImplementedError()

@classmethod
def extract_internal_noise(cls,data_df, group_ids, trial_id, feature_id, value_id, response_id, normalize = True):
def extract_internal_noise(cls,data_df, group_ids, trial_id, feature_id, value_id, response_id, model_file):

# for each level in group, extract internal_noise
return data_df.groupby(group_ids).apply(lambda group: cls.extract_single_internal_noise(group,
trial_id, feature_id, value_id, response_id)).reset_index()
trial_id, feature_id, value_id, response_id, model_file)).reset_index()


Binary file modified python/palin/simulation/__pycache__/simulation.cpython-38.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions python/palin/simulation/kernel_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, kernel_extractor, distance='CORR'):
self.distance = distance

def get_metric_names(self):
return [distance.lower()]
return [self.distance.lower()]

def analyse(self, experiment, participant, participant_responses):

Expand All @@ -36,7 +36,7 @@ def normalize_kernel(self, kernel):
return self.kernel_extractor.normalize_kernel(kernel)

def compute_distance(self, kernel_1, kernel_2):
return me.kernel_distance(kernel_1, kernel_2, type=self.distance)
return [me.kernel_distance(kernel_1, kernel_2, type=self.distance)]



2 changes: 1 addition & 1 deletion python/palin/simulation/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def run(self, config_param):

metrics = ana.get_metric_names()
values = ana.analyse(exp, obs, responses)

# return the metrics as a dict of name:value pairs
results = {}
for metric,value in zip(metrics,values):
Expand Down
594 changes: 226 additions & 368 deletions python/sandbox.ipynb

Large diffs are not rendered by default.

0 comments on commit 3548eec

Please sign in to comment.