当前位置:网站首页>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 .
边栏推荐
- Yunxin small class | common cognitive misunderstandings in IM and audio and video
- 【微服务|Sentinel】SentinelResourceAspect详解
- Practical application and extension of plain framework
- Know --matplotlib
- Depth first search and breadth first search of graph traversal
- Concepts of dictionary, hash table and array
- [micro service sentinel] sentinel integrates openfeign
- Which securities company is better and which is safer to open a securities account
- How to display real-time 2D map after rviz is opened
- Create Ca and issue certificate through go language
猜你喜欢

Matplotlib common charts

为什么PHP叫超文本预处理器

有没有一段代码,让你为人类的智慧所折服

Current situation and future development trend of Internet of things

Redis数据类型和应用场景

win 10 mstsc连接 RemoteApp

问题随记 —— /usr/bin/perl is needed by MySQL-server-5.1.73-1.glibc23.x86_64

Matplotlib常用图表

2021 RoboCom 世界机器人开发者大赛-高职组初赛

The online beggar function of Japanese shopping websites
随机推荐
深度学习 | 三个概念:Epoch, Batch, Iteration
The online beggar function of Japanese shopping websites
from pip._internal.cli.main import main ModuleNotFoundError: No module named ‘pip‘
MySQL -- convert rownum in Oracle to MySQL
Material Design组件 - 使用BottomSheet展现扩展内容(一)
Stm32f030f4 drives tim1637 nixie tube chip
Airserver latest win64 bit personal screen projection software
SWT / anr problem - SWT causes kernel fuse deadlock
What category does the Internet of things application technology major belong to
Daily three questions 6.29
Distance measurement - Hamming distance
2022年最佳智能家居开源系统:Alexa、Home Assistant、HomeKit生态系统介绍
VIM color the catalogue
notBlank 和 notEmpty
为什么PHP叫超文本预处理器
Daily three questions 6.28
The difference between timer and scheduledthreadpoolexecutor
Notes on problems - /usr/bin/perl is needed by mysql-server-5.1.73-1 glibc23.x86_ sixty-four
Know --matplotlib
Zhao Fuquan: to ensure supply in the short term, we should build a safe, efficient and resilient supply chain in the long term