deleted: best_model.pth new file: checkpoints/forward/best_tcn_model.pt new file: checkpoints/forward/training_history.csv new file: evaluation_outputs/forward/evaluation_forward_test_b0_s0.png new file: sanity_check_alignment_forward.png modified: src/__pycache__/config.cpython-310.pyc modified: src/__pycache__/config.cpython-314.pyc modified: src/__pycache__/dataset.cpython-310.pyc modified: src/__pycache__/dataset.cpython-314.pyc modified: src/__pycache__/model.cpython-310.pyc modified: src/__pycache__/model.cpython-314.pyc modified: src/config.py modified: src/dataset.py modified: src/evaluate.py modified: src/model.py new file: src/sanity_check.py modified: src/train.py renamed: src/__init__.py -> src_old/__init__.py new file: src_old/__pycache__/config.cpython-310.pyc new file: src_old/__pycache__/config.cpython-314.pyc new file: src_old/__pycache__/dataset.cpython-310.pyc new file: src_old/__pycache__/dataset.cpython-314.pyc new file: src_old/__pycache__/evaluate.cpython-314.pyc new file: src_old/__pycache__/model.cpython-310.pyc new file: src_old/__pycache__/model.cpython-314.pyc new file: src_old/__pycache__/train.cpython-310.pyc new file: src_old/__pycache__/train.cpython-314.pyc new file: src_old/config.py new file: src_old/dataset.py new file: src_old/evaluate.py new file: src_old/model.py new file: src_old/train.py deleted: test_results.png
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
import os
|
||
|
||
# Data Configuration
|
||
# 使用基于当前文件的绝对路径拼接,以防止你在不同目录下运行报错
|
||
DATA_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'downloads')
|
||
SEQ_LEN = 512 # 滑动窗口的长度 (时间序列步数)
|
||
STEP_SIZE = 20 # 滑动窗口的步长
|
||
BATCH_SIZE = 128
|
||
|
||
# Features Configuration
|
||
INPUT_SENSOR = 'WSMS00012'
|
||
OUTPUT_SENSORS = ['WSMS00007', 'WSMS00008', 'WSMS00009', 'WSMS00010', 'WSMS00011']
|
||
INPUT_AXIS = 'value1' # 底部传感器输入轴(课程要求:X轴)
|
||
OUTPUT_AXIS = 'value3' # 目标传感器输出轴
|
||
|
||
# Model Configuration
|
||
CHANNELS = [64, 64, 128, 128, 256, 256] # TCN 各层通道数
|
||
KERNEL_SIZE = 5
|
||
DROPOUT = 0.1
|
||
|
||
# Training Configuration
|
||
LEARNING_RATE = 3e-4
|
||
EPOCHS = 50
|
||
WEIGHT_DECAY = 1e-4
|
||
ENABLE_EARLY_STOP = False
|
||
EARLY_STOP_PATIENCE = 15
|
||
SPECTRAL_LOSS_WEIGHT = 0.25
|
||
CORR_LOSS_WEIGHT = 0.05
|
||
MSE_LOSS_WEIGHT = 0.5
|
||
STD_LOSS_WEIGHT = 0.3
|
||
PEAK_LOSS_WEIGHT = 0.2
|
||
CORR_LOSS_EPS = 1e-8
|
||
|
||
# Device
|
||
import torch
|
||
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|