Skip to content
Snippets Groups Projects
Commit 147c85f3 authored by Philipp Arras's avatar Philipp Arras
Browse files

Start working on getting_started_3

parent 226a52f7
No related branches found
No related tags found
1 merge request!367WIP: Normalized amplitudes pp
Pipeline #63020 failed
...@@ -56,34 +56,12 @@ if __name__ == '__main__': ...@@ -56,34 +56,12 @@ if __name__ == '__main__':
filename = "getting_started_3_mode_{}_".format(mode) + "{}.png" filename = "getting_started_3_mode_{}_".format(mode) + "{}.png"
position_space = ift.RGSpace([128, 128]) position_space = ift.RGSpace([128, 128])
harmonic_space = position_space.get_default_codomain() power_space = ift.PowerSpace(position_space.get_default_codomain())
ht = ift.HarmonicTransformOperator(harmonic_space, position_space)
power_space = ift.PowerSpace(harmonic_space) cfmaker = ift.CorrelatedFieldMaker()
cfmaker.add_fluctuations(power_space, 1, 1e-2, 1, 1e-2, 1, 1e-2, -3, 0.5, '')
# Set up an amplitude operator for the field correlated_field = cfmaker.finalize(1e-3, 1e-6, '')
dct = { A = cfmaker.amplitudes[0]
'target': power_space,
'n_pix': 64, # 64 spectral bins
# Spectral smoothness (affects Gaussian process part)
'a': 3, # relatively high variance of spectral curbvature
'k0': .4, # quefrency mode below which cepstrum flattens
# Power-law part of spectrum:
'sm': -5, # preferred power-law slope
'sv': .5, # low variance of power-law slope
'im': 0, # y-intercept mean, in-/decrease for more/less contrast
'iv': .3 # y-intercept variance
}
A = ift.SLAmplitude(**dct)
# Build the operator for a correlated signal
power_distributor = ift.PowerDistributor(harmonic_space, power_space)
vol = harmonic_space.scalar_dvol**-0.5
xi = ift.ducktape(harmonic_space, None, 'xi')
correlated_field = ht(vol*power_distributor(A)*xi)
# Alternatively, one can use:
# correlated_field = ift.CorrelatedField(position_space, A)
# Apply a nonlinearity # Apply a nonlinearity
signal = ift.sigmoid(correlated_field) signal = ift.sigmoid(correlated_field)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment