当前位置:网站首页>Reproduction process and problems of analog transformer (ICLR 2022 Spotlight)
Reproduction process and problems of analog transformer (ICLR 2022 Spotlight)
2022-07-01 23:28:00 【Mind regulating and alchemy】
The author recommends python3.6,pytorch 1.4
1. Environmental changes
Try installing pytorch 1.4 function , But the code will get stuck , And there's no mistake . The positioning error is :Anomaly-Transformer/model/attn.py
self.distances = torch.zeros((window_size, window_size)).cuda().cuda() Get stuck : as a result of Installed pytorch 1.4 Corresponding CUDA Version is 10.x, The power of calculation is sm_86,CUDA 10.x Highest support to sm_75, Therefore need CUDA 11.x To support sm_8.x.
So upgrade My environment python3.7, pytorch 1.12 , The graphics card 3080Ti, CUDA edition :11.3
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorchRun the training script again , An error again :
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [512, 25]], which is output 0 of AsStridedBackward0, is at version 2; expected version 1 instead. Hint: enable anomaly detection to find the operation that failed to compute its gradient, with torch.autograd.set_detect_anomaly(True).
solve : Comment out Anomaly-Transformer/solver.py One of the first .step():
# Minimax strategy
loss1.backward(retain_graph=True)
# self.optimizer.step()
loss2.backward()
self.optimizer.step()Reference resources :Why the optimizer.step() write twice? · Issue #8 · thuml/Anomaly-Transformer · GitHub
2. Congratulations ! Running successfully !
python main.py --anormly_ratio 1 --num_epochs 3 --batch_size 128 --mode train --dataset PSM --data_path dataset/PSM --input_c 25 --output_c 25------------ Options -------------
anormly_ratio: 1.0
batch_size: 128
data_path: dataset/PSM
dataset: PSM
input_c: 25
k: 3
lr: 0.0001
mode: train
model_save_path: checkpoints
num_epochs: 3
output_c: 25
pretrained_model: None
win_size: 100
======================TEST MODE======================
/opt/conda/lib/python3.7/site-packages/torch/nn/_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.
warnings.warn(warning.format(ret))
Threshold : 0.002150955616962149
pred: (87800,)
gt: (87800,)
pred: (87800,)
gt: (87800,)
Accuracy : 0.9848, Precision : 0.9713, Recall : 0.9739, F-score : 0.9726
The results in the paper : about PSM Data sets
P: 96.91,R: 98.9, F1: 97.89
Recurring Recall Slightly lower . however Precision Slightly higher . The two need to be weighed . You can adjust the above Threshold : 0.002150955616962149 Balance the two .
边栏推荐
- The digital summit is popular, and city chain technology has triggered a new round of business transformation
- Airserver latest win64 bit personal screen projection software
- 距离度量 —— 汉明距离(Hamming Distance)
- plain framework的实际应用和扩展
- 字典、哈希表、数组的概念
- Win 10 mstsc connect RemoteApp
- 从第三次技术革命看企业应用三大开发趋势
- Redis数据类型和应用场景
- CADD课程学习(3)-- 靶点药物相互作用
- Redis data types and application scenarios
猜你喜欢

神经网络物联网的发展趋势和未来方向

What category does the Internet of things application technology major belong to

Matplotlib常用设置

Linux foundation - centos7 offline installation of MySQL

Experience of practical learning of Silicon Valley products

Redis AOF日志

CKS CKA ckad change terminal to remote desktop

Why is PHP called hypertext preprocessor

win 10 mstsc连接 RemoteApp

Huisheng Huiying 2022 intelligent, fast and simple video editing software
随机推荐
Paramètres communs de matplotlib
股票开户哪个证券公司最好,有安全保障吗
notBlank 和 notEmpty
What is the mosaic tailgate?
Applet form verification encapsulation
MySQL binlog cleanup
认识--Matplotlib
Redis RDB快照
Matplotlib常用設置
物联网技术应用属于什么专业分类
flutter Unable to load asset: assets/images/888. png
Daily three questions 6.28
Aaai22 | structural tagging and interaction modeling: a "slim" network for graph classification
距离度量 —— 汉明距离(Hamming Distance)
Who do you want to know when opening a stock account? Is it safe to open an account online?
Understanding threads
【微服务|Sentinel】SentinelResourceAspect详解
jpa手写sql,用自定义实体类接收
【必会】BM41 输出二叉树的右视图【中等+】
Future trend and development of neural network Internet of things