many improvements

This commit is contained in:
Mayeul Aubin 2025-06-17 18:07:06 +02:00
parent c07ec8f8cf
commit 6c526d7115
4 changed files with 219 additions and 53 deletions

View file

@ -1,12 +1,23 @@
def prepare_data(batch):
def prepare_data(batch,
scale_phi_ini:float = 1000.0,
scale_delta_ini:float = 12.0,
scale_target:float = 600.0,
):
phi_ini = batch['input'][:, [1]]
D1 = batch['style'][:, [0]]
D2 = batch['style'][:, [1]]
gravpot = batch['target'][:, [0]]
# delta_ini = batch['input'][:, [0], :, :, :]
phi_ini = batch['input'][:, [1], :, :, :]
D1 = batch['style'][:, [0], None, None, None]
# D2 = batch['style'][:, [1], None, None, None]
gravpot = batch['target'][:, [0], :, :, :]
_input = batch['input']
_input[:, 0, :, :, :] /= scale_delta_ini
_input[:, 1, :, :, :] /= scale_phi_ini
_target = (gravpot/D1 - phi_ini)/D1
_target /= scale_target
_style = batch['style']
return {