Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support to specify the range and resolution of parameter spaces #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kinpzz
Copy link

@Kinpzz Kinpzz commented Sep 15, 2019

Commit 1. The hard-code mapping function is replaced by the mapping function based on specific parameter spaces defined by users. The original hard-code mapping function can be regarded as the mapping function of the parameter space with special ranges and resolutions, which are served as the default values of the new mapping function.

peakSensitivity = 0.1*params[:,0] + 0.3
peakFrequency = -0.7 + 0.1*params[:,1]
bandwidth = 0.05 * params[:,2]
logDelta = -1.7 + 0.1 * params[:,3]
parameterSettings = parser.add_argument_group('Parameters')
parameterSettings.add_argument('-minps', '--minPeakSensitivity', type=float, default=2.0, help='The lower bound of peak sensitivity value (>1.0)')
parameterSettings.add_argument('-maxps', '--maxPeakSensitivity', type=float, default=1000.0, help='The upper bound of peak sensitivity value')
parameterSettings.add_argument('-psr', '--peakSensitivityResolution', type=int, default=28, help='The number of peak sensitivity steps')

parameterSettings.add_argument('-minpf', '--minPeakFrequency', type=float, default=.2, help='The lower bound of peak frequency value (>0)')
parameterSettings.add_argument('-maxpf', '--maxPeakFrequency', type=float, default=20.0, help='The upper bound of peak frequency value')
parameterSettings.add_argument('-pfr', '--peakFrequencyResolution', type=int, default=21, help='The number of peak frequency steps')

parameterSettings.add_argument('-minb', '--minBandwidth', type=float, default=1.0, help='The lower bound of bandwidth value')
parameterSettings.add_argument('-maxb', '--maxBandwidth', type=float, default=10.0, help='The upper bound of bandwidth value')
parameterSettings.add_argument('-br', '--bandwidthResolution', type=int, default=21, help='The number of bandwidth steps')

parameterSettings.add_argument('-mind', '--minLogDelta', type=float, default=.02, help='The lower bound of logdelta value')
parameterSettings.add_argument('-maxd', '--maxLogDelta', type=float, default=2.0, help='The upper bound of logdelta value')
parameterSettings.add_argument('-dr', '--logDeltaResolution', type=int, default=21, help='The number of logdelta steps')

Commit 2. The peak sensitivity space and peak frequency space should be subspaces of stimuli spaces (1/contrast, frequency). Thus, a simple parameter validation is added to check whether the range of peak sensitivity is smaller than the range of 1/contrast. For example, the range of contrast (0.01, 1) corresponds to the range of sensitivity (1, 100). However, it is too small for searching the value of peak sensitivity in the range of (2, 1000).

@domstoppable
Copy link
Member

Emailed this to you, but also writing here just in case:

With your other changes in place, we should also modify the inputs to simulations (simulate.py, runSimulation()) so that the true parameter values (truePeakSensitivity, truePeakFrequency, trueBandwidth, trueDelta) can be specified as real-values, rather than indexes, with units matching what's generated as output. If you can do that, then users will never have to deal with indexes - they will only work with real values for both input and output, which would be great. It's also necessary for running simulations with edge-cases like when a parameter's true value falls outside of the range that's been set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants