petecheng / Time2Graph

Source codes for Time2Graph model.
133 stars 33 forks source link

NotImplementedError: unsupported mode embedding #4

Open wangdong2222 opened 2 years ago

wangdong2222 commented 2 years ago

请问这个是什么原因?谢谢!

python3 scripts/std_test.py

[info]running with {'dataset': 'ucr-Earthquakes', 'n_splits': 5, 'model_cache': False, 'shapelet_cache': False, 'gpu_enable': False} ./dataset/UCRArchive_2018/Earthquakes/Earthquakes_TEST.tsv [info]training: 0.18 positive ratio with 322 [info]test: 0.25 positive ratio with 139 init model [info]initialize t2g model with {'kernel': 'xgb', 'kwargs': {'num_segment': 21, 'candidate_method': 'greedy'}, 'K': 50, 'C': 800, 'seg_length': 24, 'warp': 2, 'tflag': True, 'opt_metric': 'accuracy', 'mode': 'embedding', 'batch_size': 100, 'gpu_enable': False, 'percentile': 5, 'shapelets': None, 'sembeds': None, 'clf': None, 'lr': 0.01, 'p': 2, 'alpha': 0.1, 'beta': 0.05, 'multi_graph': False, 'debug': True, 'measurement': 'gdtw', 'verbose': False, 'global_flag': True} [info]training ucr-Earthquakes_tim2graph_model ... train model [info]training embedding model... [info]initialize ShapeletEmbedding model with ops: {'seg_length': 24, 'tflag': True, 'multi_graph': False, 'cache_dir': '/home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/scripts/cache/', 'tanh': False, 'debug': True, 'percentile': 5, 'dist_threshold': -1, 'measurement': 'gdtw', 'mode': 'embedding', 'global_flag': True, 'deepwalk_args': {'num_segment': 21, 'candidate_method': 'greedy'}, 'embed_size': 256, 'embeddings': None} [info]fit shape: (264, 504, 1) [info]threshold(5) 0.012702378537505865, mean 0.2733875811100006 [info]15359 edges involved in shapelets graph [info]embed_size: 256 [info]transition matrix size (1, 50, 50) [info]run deepwalk with: deepwalk --input /home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/scripts/cache//0.edgelist --format weighted_edgelist --output /home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/scripts/cache//0.embeddings --representation-size 256 [info]embedding threshold 0.012702378537505865 [info]sdist size (322, 21, 50) Traceback (most recent call last): File "scripts/std_test.py", line 77, in m.fit(X=x_train, Y=y_train, n_splits=args.n_splits, tuning=False, opt_args=xgb_options) File "/home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/time2graph/core/model.py", line 163, in fit x = self.extract_features(X=X, init=self.init) File "/home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/time2graph/core/model.py", line 114, in extract_features embed = self.t2g.embed(x=X, init=init) File "/home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/time2graph/core/model_embeds.py", line 101, in embed return self.sembeds.time_series_embedding(time_series_set=x, shapelets=self.shapelets, warp=self.warp, init=init) File "/home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/time2graph/core/shapelet_embedding.py", line 183, in time_series_embedding multi_graph=self.multi_graph, debug=self.debug, mode=self.mode), File "/home/wangdong/tool/notebook/jupyter/time2graph/Time2Graph-master/time2graph/core/shapelet_embedding.py", line 80, in time_series_embeds_factory__ raise NotImplementedError('unsupported mode {}'.format(mode)) NotImplementedError: unsupported mode embedding

petecheng commented 2 years ago

It is a typo that mode should be set as "aggregate" or "concate".