RatInABox-Lab / RatInABox

A python package for modelling locomotion in complex environments and spatially/velocity selective cell activity.
MIT License
175 stars 31 forks source link

Distance tuning #47

Closed jquinnlee closed 1 year ago

jquinnlee commented 1 year ago

Hey Tom,

Got the changes together here and I just gave them a spin and everything seems to be in working order. So now the distribution options read:

# define tuning distances from specific distribution in params dict
        if self.pref_wall_dist_distribution == 'ralyeigh':
            self.tuning_distances = np.random.rayleigh(scale=self.pref_wall_dist,
                                                       size=self.n)
        elif self.pref_wall_dist_distribution == 'uniform':
            self.tuning_distances = np.random.uniform(low=0,
                                                      high=self.pref_wall_dist * 2,
                                                      size=self.n)
        elif self.pref_wall_dist_distribution == 'normal':
            lower, upper = 0, self.Agent.Environment.scale
            mu, sigma = self.pref_wall_dist, self.pref_wall_dist / 2
            self.tuning_distances = scipy.stats.truncnorm.rvs((lower - mu)/sigma,
                                                              (upper-mu)/sigma,
                                                              scale=sigma,
                                                              size=self.n,
                                                              loc=mu)
        elif self.pref_wall_dist_distribution == 'delta':
            self.tuning_distances = self.pref_wall_dist * np.ones(self.n)
jquinnlee commented 1 year ago

Sorry created this as a new pull request I meant to have it follow up on #46

jquinnlee commented 1 year ago

Rock n roll!