Commit c1a84f56 authored by Philipp Frank's avatar Philipp Frank
Browse files

resolution independent amplitude model priors

parent 6ddae70b
...@@ -32,7 +32,7 @@ if __name__ == '__main__': ...@@ -32,7 +32,7 @@ if __name__ == '__main__':
position_space = ift.RGSpace([128, 128]) position_space = ift.RGSpace([128, 128])
# Setting up an amplitude model # Setting up an amplitude model
A = ift.AmplitudeModel(position_space, 16, 1, 10, -4., 1, 0., 1.) A = ift.AmplitudeModel(position_space, 64, 3, 0.4, -4., 1, 1., 1.)
dummy = ift.from_random('normal', A.domain) dummy = ift.from_random('normal', A.domain)
# Building the model for a correlated signal # Building the model for a correlated signal
...@@ -46,9 +46,11 @@ if __name__ == '__main__': ...@@ -46,9 +46,11 @@ if __name__ == '__main__':
'xi': harmonic_space 'xi': harmonic_space
}))) })))
correlated_field = ht(power_distributor(A)*ift.FieldAdapter(domain, "xi")) vol = harmonic_space.scalar_dvol
vol = ift.ScalingOperator(vol ** (-0.5),harmonic_space)
correlated_field = ht(vol(power_distributor(A))*ift.FieldAdapter(domain, "xi"))
# alternatively to the block above one can do: # alternatively to the block above one can do:
# correlated_field = ift.CorrelatedField(position_space, A) #correlated_field = ift.CorrelatedField(position_space, A)
# apply some nonlinearity # apply some nonlinearity
signal = ift.positive_tanh(correlated_field) signal = ift.positive_tanh(correlated_field)
......
...@@ -29,7 +29,7 @@ from ..sugar import makeOp, sqrt ...@@ -29,7 +29,7 @@ from ..sugar import makeOp, sqrt
def _ceps_kernel(dof_space, k, a, k0): def _ceps_kernel(dof_space, k, a, k0):
return a**2/(1+(k/(k0*dof_space.bindistances[0]))**2)**2 return a**2/(1+(k/k0)**2)**2
def create_cepstrum_amplitude_field(domain, cepstrum): def create_cepstrum_amplitude_field(domain, cepstrum):
......
...@@ -44,9 +44,8 @@ def CorrelatedField(s_space, amplitude_model): ...@@ -44,9 +44,8 @@ def CorrelatedField(s_space, amplitude_model):
power_distributor = PowerDistributor(h_space, p_space) power_distributor = PowerDistributor(h_space, p_space)
A = power_distributor(amplitude_model) A = power_distributor(amplitude_model)
vol = h_space.scalar_dvol vol = h_space.scalar_dvol
#vol = 1.
vol = ScalingOperator(vol ** (-0.5),h_space) vol = ScalingOperator(vol ** (-0.5),h_space)
return ht(vol(A*FieldAdapter(MultiDomain.make({"xi": h_space}), "xi"))) return ht(vol(A)*FieldAdapter(MultiDomain.make({"xi": h_space}), "xi"))
def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial, def MfCorrelatedField(s_space_spatial, s_space_energy, amplitude_model_spatial,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment