Upgrade LFNA
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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( | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user