Upgrade LFNA

This commit is contained in:
D-X-Y 2021-05-13 13:42:33 +00:00
parent cfabd05de8
commit c2fa181bc5
3 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#####################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.04 #
#####################################################
# python exps/LFNA/lfna.py --env_version v1
# python exps/LFNA/lfna.py --env_version v1 --device cuda
#####################################################
import sys, time, copy, torch, random, argparse
from tqdm import tqdm

View File

@ -55,6 +55,7 @@ class LFNA_Meta(super_core.SuperModule):
order=super_core.LayerOrder.PostNorm,
)
)
layers.append(super_core.SuperLinear(time_embedding, time_embedding))
self.meta_corrector = super_core.SuperSequential(*layers)
model_kwargs = dict(

View File

@ -110,8 +110,10 @@ class SyntheticDEnv(data.Dataset):
if self._seq_length is None:
return self.__call__(timestamp)
else:
noise = random.random() * self.timestamp_interval * 0.3
timestamps = [
timestamp + i * self.timestamp_interval for i in range(self._seq_length)
timestamp + i * self.timestamp_interval + noise
for i in range(self._seq_length)
]
xdata = [self.__call__(timestamp) for timestamp in timestamps]
return zip_sequence(xdata)