Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
b03c7fd
Create a pull request
bojunZhang-heng Jun 20, 2025
71c5c85
Model_Evaluation.sh Init
bojunZhang-heng Jun 20, 2025
792b732
Model_Preprocess.sh Init
bojunZhang-heng Jun 20, 2025
d6f8a22
Model_Test.sh Init
bojunZhang-heng Jun 20, 2025
5beacaf
Model_Training.sh Init
bojunZhang-heng Jun 20, 2025
e26e4c1
python_learn Init
bojunZhang-heng Jun 20, 2025
d2df2f0
Pressure_train.lsf uInit
bojunZhang-heng Jun 20, 2025
4ea678a
My_python_job/train.py update
bojunZhang-heng Jun 21, 2025
776a23f
My_python_job/Usage_train.py upadte
bojunZhang-heng Jun 21, 2025
cc3072b
Usage_train.py update
bojunZhang-heng Jun 21, 2025
7165861
train.py update
bojunZhang-heng Jun 21, 2025
ff134a9
Model_Training.sh update
bojunZhang-heng Jun 21, 2025
683e256
My_python_job/Usage_train.py update
bojunZhang-heng Jun 21, 2025
3f4afa3
My_python_job/train.py update
bojunZhang-heng Jun 21, 2025
6446ca2
data_loader.py update
bojunZhang-heng Jun 21, 2025
b8d8812
train.py update
bojunZhang-heng Jun 21, 2025
f31b705
Pressure_train.lsf update
bojunZhang-heng Jun 21, 2025
e35b92f
My_python_job/Usage_data_loader.py update
bojunZhang-heng Jun 21, 2025
b4e20f5
My_python_job/Usage_model_pressure.py data_loader.py update
bojunZhang-heng Jun 21, 2025
4245b11
My_python_job/utils.py update
bojunZhang-heng Jun 21, 2025
3990fff
Model_Training.sh update
bojunZhang-heng Jun 24, 2025
429a8f5
My_python_job/Model_Training.sh update
bojunZhang-heng Jun 24, 2025
9a35ed3
My_python_job/Usage_data_loader.py update
bojunZhang-heng Jun 24, 2025
1f70f94
My_python_job/Usage_train.py update
bojunZhang-heng Jun 24, 2025
378b488
My_python_job/run_pipeline.py update
bojunZhang-heng Jun 24, 2025
1900d0e
My_python_job/train.py update
bojunZhang-heng Jun 24, 2025
821a2cd
My_python_job/data_loader.py update
bojunZhang-heng Jun 24, 2025
687434f
run_pipeline.py update
bojunZhang-heng Jun 24, 2025
ac306bc
My_python_job/Pressure_train.lsf
bojunZhang-heng Jun 24, 2025
cb50162
My_python_job/model_pressure.py update
bojunZhang-heng Jun 24, 2025
e7513ef
My_python_job/Usage_run_pipeline.py
bojunZhang-heng Jun 24, 2025
b4a9d8d
.gitignore updata
bojunZhang-heng Jun 24, 2025
623324e
.gitignore update
bojunZhang-heng Jun 24, 2025
a00064e
My_python_job/Model_Training.sh update
bojunZhang-heng Jun 24, 2025
87f1cf5
My_python_job/Usage_train.py update
bojunZhang-heng Jun 24, 2025
73b54f0
My_python_job/run_pipeline.py update
bojunZhang-heng Jun 24, 2025
7fe6185
My_python_job/train.py
bojunZhang-heng Jun 24, 2025
90a36dc
My_python_job/model_pressure.py update
bojunZhang-heng Jun 24, 2025
1232c57
My_python_job/model_pressure.py self.bn3->self.bn4 update
bojunZhang-heng Jun 24, 2025
a92212b
My_python_job/Usage_model_pressure.py update
bojunZhang-heng Jun 24, 2025
f406df1
My_python_job/Usage_run_pipeline.py update
bojunZhang-heng Jun 24, 2025
dbb417c
My_python_job/train.py update
bojunZhang-heng Jun 24, 2025
87703a2
.gitignore update
bojunZhang-heng Jun 24, 2025
b92e835
Usage_model_pressure.py update
bojunZhang-heng Jun 25, 2025
653b8a9
model_pressure.py update
bojunZhang-heng Jun 25, 2025
bb9bfe4
My_python_job/Usage_data_loader.py update
bojunZhang-heng Jun 25, 2025
1a64135
My_python_job/Usage_train.py update
bojunZhang-heng Jun 25, 2025
374be39
My_python_job/data_loader.py update
bojunZhang-heng Jun 25, 2025
ad094fe
My_python_job/train.py update
bojunZhang-heng Jun 25, 2025
314fb1f
train.py update
bojunZhang-heng Jun 25, 2025
fc6fba9
error.py update
bojunZhang-heng Jun 25, 2025
31efcee
error_convergence.png update
bojunZhang-heng Jun 25, 2025
3c8214a
My_python_job/Model_Training.sh update
bojunZhang-heng Jun 26, 2025
6ef7f86
My_python_job/Usage_data_loader.py
bojunZhang-heng Jun 26, 2025
aa6a143
My_python_job/data_loader.py update
bojunZhang-heng Jun 26, 2025
8857bc8
My_python_job/train.py update
bojunZhang-heng Jun 26, 2025
dd60153
Model_Training.sh update
bojunZhang-heng Jun 27, 2025
b49eeba
Pressure_train.lsf update
bojunZhang-heng Jun 27, 2025
d5cde42
Usage_train.py update
bojunZhang-heng Jun 27, 2025
8504d1a
train.py update
bojunZhang-heng Jun 27, 2025
50668dd
Usage_HyperParameter.py update
bojunZhang-heng Jun 27, 2025
5c626d2
Model_Training.sh update
bojunZhang-heng Jun 28, 2025
9503b51
Pressure_train.lsf update
bojunZhang-heng Jun 28, 2025
f3d667e
Usage_HyperParameter.py update
bojunZhang-heng Jun 28, 2025
849d510
Usage_train.py update
bojunZhang-heng Jun 28, 2025
34ecfdc
train.py update
bojunZhang-heng Jun 28, 2025
b33b8aa
.gitignore update
bojunZhang-heng Jun 28, 2025
e1dd167
Model_Preprocess.sh update
bojunZhang-heng Jun 28, 2025
051f1ef
tail.sh update
bojunZhang-heng Jun 28, 2025
bd5d8a9
experiments/ check png file
bojunZhang-heng Jun 28, 2025
2ac80e2
My_python_job/Usage_train.py update
bojunZhang-heng Jun 30, 2025
6baeb89
My_python_job/experiments/ update
bojunZhang-heng Jun 30, 2025
ef5bc98
My_python_job/train.py update
bojunZhang-heng Jun 30, 2025
2c50f27
train.py update
bojunZhang-heng Jun 30, 2025
1230761
GPU_list.sh update
bojunZhang-heng Jun 30, 2025
deea1ee
tail.sh update
bojunZhang-heng Jun 30, 2025
4824d50
train.py init
bojunZhang-heng Jun 30, 2025
96989b9
My_python_job/experiments/ update
bojunZhang-heng Jul 2, 2025
2f03fb9
My_python_job/train.py update
bojunZhang-heng Jul 2, 2025
6699745
train.py udpate
bojunZhang-heng Jul 2, 2025
7375046
run_pipeline.py update
bojunZhang-heng Jul 2, 2025
0068c05
experiments/ update
bojunZhang-heng Jul 2, 2025
634076e
.gitignore update
bojunZhang-heng Jul 2, 2025
cf96bff
My_python_job/train.py update
bojunZhang-heng Jul 2, 2025
f720a4b
delete *.png update
bojunZhang-heng Jul 2, 2025
95eaa83
experiments/ update
bojunZhang-heng Jul 4, 2025
0719fa6
My_python_job/experiments/ update
bojunZhang-heng Jul 4, 2025
0b2a0a6
./My_python_job/experiments/ update
bojunZhang-heng Jul 4, 2025
8a835e6
GPU_list.sh update
bojunZhang-heng Jul 4, 2025
4e42a5a
shell script update
bojunZhang-heng Jul 4, 2025
ef5aadd
Pressure_train.lsf update
bojunZhang-heng Jul 4, 2025
83354ed
move script into model_script folder
bojunZhang-heng Jul 4, 2025
fcc5178
Move usage file into Usage_python
bojunZhang-heng Jul 4, 2025
dc80e5d
My_python_job/experiments/ update
bojunZhang-heng Jul 4, 2025
b86a8a0
My_python_job/train.py update
bojunZhang-heng Jul 4, 2025
9ab58be
My_python_job/experiments/
bojunZhang-heng Jul 4, 2025
4e7d270
Merge branch 'Mohamedelrefaie:main' into Pressure_Filed
bojunZhang-heng Jul 4, 2025
f22d347
PRESSURE_ variable is python scalar update
bojunZhang-heng Jul 4, 2025
b61f6e0
./Model_Training.sh update
bojunZhang-heng Jul 4, 2025
51d8201
My_python_job/Model_Script/Model_Training.sh update
bojunZhang-heng Jul 4, 2025
f3bfdf5
My_python_job/Pressure_train.lsf update
bojunZhang-heng Jul 4, 2025
4156701
My_python_job/experiments/Train_Test/ update
bojunZhang-heng Jul 4, 2025
701aead
My_python_job/experiments/ update
bojunZhang-heng Jul 4, 2025
fb28ace
Pressure_train.lsf update
bojunZhang-heng Jul 4, 2025
fa00804
My_python_job/experiments/Train_Test/ update
bojunZhang-heng Jul 4, 2025
b2d7473
Save local edits
bojunZhang-heng Jul 4, 2025
7af39b1
My_python_job/experiments/Train_Test/ update
bojunZhang-heng Jul 4, 2025
2d397b5
update
bojunZhang-heng Jul 4, 2025
29c5a35
update
bojunZhang-heng Jul 4, 2025
04dc766
My_python_job/experiments/Train_Test/ update
bojunZhang-heng Jul 4, 2025
599e327
train.py PRESSURE_ a pytroch tensor update
bojunZhang-heng Jul 4, 2025
180af98
experiments/ update
bojunZhang-heng Jul 4, 2025
646d146
My_python_job/ update
bojunZhang-heng Jul 4, 2025
95b1ce5
Revert "train.py PRESSURE_ a pytroch tensor update"
bojunZhang-heng Jul 4, 2025
b7566df
run_pipeline.py update
bojunZhang-heng Jul 4, 2025
391f607
My_python_job/Model_Script/Model_Preprocess.sh update
bojunZhang-heng Jul 5, 2025
fbb0d53
My_python_job/Model_Script/Model_Training.sh update
bojunZhang-heng Jul 5, 2025
52db900
My_python_job/experiments/ update
bojunZhang-heng Jul 5, 2025
69a1327
My_python_job/run_pipeline.py update
bojunZhang-heng Jul 5, 2025
b1c795b
My_python_job/train.py update
bojunZhang-heng Jul 5, 2025
d527ef2
My_python_job/Model_Script/Model_Evaluate.sh update
bojunZhang-heng Jul 5, 2025
eebd0a6
My_python_job/evaluate.py update
bojunZhang-heng Jul 5, 2025
dcf1f1e
My_python_job/results/ update
bojunZhang-heng Jul 5, 2025
7116d78
My_python_job/evaluate.py update
bojunZhang-heng Jul 7, 2025
3e23c72
My_python_job/results/ update
bojunZhang-heng Jul 7, 2025
bb51bce
Pressure_train.lsf update
bojunZhang-heng Jul 7, 2025
2725268
./evaluate.py update
bojunZhang-heng Jul 7, 2025
77daae2
./experiments/ update
bojunZhang-heng Jul 7, 2025
a0dfd16
My_python_job/Pressure_train.lsf update
bojunZhang-heng Jul 7, 2025
0ed188c
My_python_job/Usage_python/Usage_Colorama.py update
bojunZhang-heng Jul 7, 2025
0e1e020
My_python_job/Usage_python/Usage_evaluate.py update
bojunZhang-heng Jul 7, 2025
c0cd606
./results/ update
bojunZhang-heng Jul 7, 2025
970dd34
rm experiments
bojunZhang-heng Jul 7, 2025
207aec0
./experiments/ corret version
bojunZhang-heng Jul 7, 2025
c611b40
./experiments/ delete
bojunZhang-heng Jul 7, 2025
9d3c83a
./experiments/ update
bojunZhang-heng Jul 7, 2025
2ed5138
My_python_job/Usage_python/Usage_Colorama.py update
bojunZhang-heng Jul 8, 2025
d83361d
My_python_job/evaluate.py update
bojunZhang-heng Jul 8, 2025
d49da7e
My_python_job/results/ update
bojunZhang-heng Jul 8, 2025
b7c5f62
My_python_job/results/Train_Test/visualize_plt.py update
bojunZhang-heng Jul 8, 2025
e493e25
My_python_job/results/Train_Test/visualization.png update
bojunZhang-heng Jul 8, 2025
6ae8dd9
results/Train_Test/visualize_plt.py update
bojunZhang-heng Jul 8, 2025
9a5a7e3
results/Train_Test/visualize_plt.py deleted
bojunZhang-heng Jul 8, 2025
4437622
results/ update
bojunZhang-heng Jul 8, 2025
139aa2a
My_python_job/Usage_python/Usage_visualize_ply.py update
bojunZhang-heng Jul 8, 2025
e3940c7
My_python_job/visualize_plt.py update
bojunZhang-heng Jul 8, 2025
04bef92
results/ update
bojunZhang-heng Jul 8, 2025
393149e
results/ update
bojunZhang-heng Jul 8, 2025
8ee75a9
My_python_job/Usage_python/Usage_visualize_ply.py update
bojunZhang-heng Jul 8, 2025
1e1d962
My_python_job/visualize_plt.py update
bojunZhang-heng Jul 8, 2025
1eb9049
My_python_job/results/ update
bojunZhang-heng Jul 8, 2025
db994e1
My_python_job/visualize_plt.py update
bojunZhang-heng Jul 8, 2025
f7dde31
My_python_job/results/ update
bojunZhang-heng Jul 8, 2025
5ca311e
Pressure_train.lsf update
bojunZhang-heng Jul 8, 2025
696ce86
My_python_job/evaluate.py update
bojunZhang-heng Jul 8, 2025
840d50b
results/ update
bojunZhang-heng Jul 8, 2025
f6e4196
Pressure_train.lsf update
bojunZhang-heng Jul 8, 2025
e400667
Model_Script/Model_Preprocess.sh update
bojunZhang-heng Jul 8, 2025
d38bfa2
My_python_job/Usage_python/Usage_data_loader.py update
bojunZhang-heng Jul 8, 2025
8fd0922
My_python_job/data_loader.py update
bojunZhang-heng Jul 8, 2025
80fe513
My_python_job/run_pipeline.py update
bojunZhang-heng Jul 8, 2025
f512825
My_python_job/Usage_python/Usage_run_pipeline.py
bojunZhang-heng Jul 8, 2025
b14d5c2
My_python_job/Pressure_train.lsf update
bojunZhang-heng Jul 8, 2025
d8b400d
My_python_job/Model_Script/Model_Evaluate.sh update
bojunZhang-heng Jul 9, 2025
485feb4
My_python_job/Model_Script/Model_Preprocess.sh update
bojunZhang-heng Jul 9, 2025
35baf53
My_python_job/Pressure_train.lsf update
bojunZhang-heng Jul 9, 2025
5e9d1b2
My_python_job/Usage_python/Usage_model_pressure.py update
bojunZhang-heng Jul 9, 2025
b446aa5
My_python_job/experiments/ update
bojunZhang-heng Jul 9, 2025
0c521be
My_python_job/model_pressure.py update
bojunZhang-heng Jul 9, 2025
42f86b3
My_python_job/results/ update
bojunZhang-heng Jul 9, 2025
e0dd508
My_python_job/run_pipeline.py update
bojunZhang-heng Jul 9, 2025
9132a16
My_python_job/Usage_python/Usage_model_pressure.py update
bojunZhang-heng Jul 9, 2025
c3957ff
My_python_job/model_pressure.py update
bojunZhang-heng Jul 9, 2025
b1d4fba
My_python_job/Usage_python/Usage_model_pressure.py update
bojunZhang-heng Jul 11, 2025
04ff3c1
My_python_job/model_pressure.py update
bojunZhang-heng Jul 11, 2025
aa34702
postProcess/
bojunZhang-heng Aug 5, 2025
6049a6f
pointNet_To_vtk.py update
bojunZhang-heng Aug 15, 2025
084341b
../../../Usage_python/Usage_model_pressure.py update
bojunZhang-heng Aug 15, 2025
ca72ba8
so many files
bojunZhang-heng Aug 15, 2025
b367562
png file
bojunZhang-heng Aug 15, 2025
dd0d578
pointNet_To_vtk.py update
bojunZhang-heng Aug 15, 2025
adf7a6a
pointNet_To_vtk.py update
bojunZhang-heng Aug 15, 2025
34cc19b
vtk file
bojunZhang-heng Aug 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions RegDGCNN_SurfaceFields/Model_Evaluation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
python run_pipeline.py \
--stages evaluate \
--exp_name "DrivAerNet_Pressure" \
--dataset_path "$HOME/ML_Turbulent/Data_Pressure_Field/Data_Pressure/PressureVTK/N_S_WWS_WM" \
--cache_dir "$HOME/ML_Turbulent/Data_Pressure_Field/Cache_data" \
--subset_dir "$HOME/ML_Turbulent/DrivAerNet/train_val_test_splits" \
--num_points 10000 \
--num_eval_samples 5 \
--gpus "0"

7 changes: 7 additions & 0 deletions RegDGCNN_SurfaceFields/Model_Preprocess.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
python run_pipeline.py \
--stages preprocess \
--exp_name "DrivAerNet_Pressure" \
--dataset_path "$HOME/ML_Turbulent/Pressure_Field/Data_Pressure/PressureVTK/N_S_WWS_WM" \
--cache_dir "$HOME/ML_Turbulent/Pressure_Field/Cache_data" \
--subset_dir "$HOME/ML_Turbulent/Pressure_Field/train_val_test_splits" \
--num_points 10000
9 changes: 9 additions & 0 deletions RegDGCNN_SurfaceFields/Model_Test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
python test_single_vtk.py \
--model_checkpoint "experiments/DrivAerNet_Pressure/best_model.pth" \
--vtk_file "$HOME/ML_Turbulent/Data_Pressure_Field/Data_Pressure/PressureVTK/N_S_WWS_WM/N_S_WWS_WM_001.vtk" \
--output_dir "visualizations" \
--num_points 10000 \
--k 40 \
--emb_dims 1024 \
--dropout 0.4

22 changes: 22 additions & 0 deletions RegDGCNN_SurfaceFields/Model_Training.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
python run_pipeline.py \
--stages train \
--exp_name "DrivAerNet_Pressure" \
--dataset_path "$HOME/ML_Turbulent/Data_Pressure_Field/Data_Pressure/PressureVTK/N_S_WWS_WM" \
--subset_dir "$HOME/ML_Turbulent/DrivAerNet/train_val_test_splits" \
--cache_dir "$HOME/ML_Turbulent/Data_Pressure_Field/Cache_data" \
--num_points 10000 \
--batch_size 12 \
--epochs 150 \
--gpus "0, 1"


# === Variable ===
# --batch_size
# It defines how many samples are processed at once per training step
#
# --epochs
#
# Total number of training rounds over the whole dataset
# e.g. 10000 samples, batch_size = 100
# 10 000 / 100 = 100 steps for one epoch
# --epochs 150 have 150 times loop
22 changes: 22 additions & 0 deletions RegDGCNN_SurfaceFields/My_python_job/Model_Training.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
python run_pipeline.py \
--stages train \
--exp_name "DrivAerNet_Pressure" \
--dataset_path "$HOME/ML_Turbulent/Data_Pressure_Field/Data_Pressure/PressureVTK/N_S_WWS_WM" \
--subset_dir "$HOME/ML_Turbulent/DrivAerNet/train_val_test_splits" \
--cache_dir "$HOME/ML_Turbulent/Data_Pressure_Field/Cache_data" \
--num_points 10000 \
--batch_size 12 \
--epochs 150 \
--gpus "0, 1, 2"


# === Variable ===
# --batch_size
# It defines how many samples are processed at once per training step
#
# --epochs
#
# Total number of training rounds over the whole dataset
# e.g. 10000 samples, batch_size = 100
# 10 000 / 100 = 100 steps for one epoch
# --epochs 150 have 150 times loop
3 changes: 3 additions & 0 deletions RegDGCNN_SurfaceFields/My_python_job/Usage_data_loader.py
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file currently appears to be empty except for import statements and a docstring. No functional code is present.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""

"""
11 changes: 11 additions & 0 deletions RegDGCNN_SurfaceFields/My_python_job/Usage_model_pressure.py
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, file currently appears to be empty except for import statements and a docstring. No functional code is present.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import torch
import torch.nn as nn

"""

"""





148 changes: 148 additions & 0 deletions RegDGCNN_SurfaceFields/My_python_job/Usage_train.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# ============ Function Usage ============
import torch
import torch.distributed as dist
import torch.multiprocessing as mp

# Import modules
from model_pressure import RegDGCNN_pressure
'''

# DDP: Distributed Data Parallel
1.----
world_size = len(gpu_list.split(','))
#!
gpu_list -> "0, 1, 2"
gpu_list.split(',') -> ['0', '1', '2']
len(gpu_list.split(',')) -> 3

2.----
exp_dir = os.path.join('experiments', args.exp_name)
#!
Build a path "./experiments/exp_name"

3.----
os.makedirs(exp_dir, exist_ok=True)
#!
Create the directory "exp_dir" if it doesn't already exist

4.----
mp.spawn(train_and_evaluate, args=(world_size, args), nprocs=world_size, join=True)
#!
train_and_evaluate(rank, world_size, args)
# rank : which GPU this process is using
# world_size : total number of GPUS
# args: your parsed command-line arguments
#!
mp.spawn(...)
->
train_evaluate(rank=0, world_size= , args=args)
train_evaluate(rank=1, world_size= , args=args)
train_evaluate(rank=2, world_size= , args=args)
train_evaluate(rank=3, world_size= , args=args)
...

5.----
dist.init_process_group(backend='nccl', init_method='env://', world_size=world_size, rank=rank)
#!
Starts the communication backend for DDP
# nccl: NVDIA backend for multi-GPU
# evv:// Uses evvironmen variables(e.g. RANK, WORLD_SIZE, etc)

6.-----
torch.cuda.set_device(local_rank)
#!
Each process uses a single GPU
Set the GPU this process will use

7.-----
args = vars(args)
#!
Convert it to a regular dictionary
e.g. {'epoch': 10, 'lr': 0.0001}

8.-----
model = RegDGCNN_pressure(args).to(local_rank)
#!
RegDGCNN_pressure(args): Creates an instance of your custom model class
.to(local_rank): Moves the model to the current corret GPU
#!
The detail please see Usage_model_pressure.pu

10.----
model = torch.nn.parallel.DistributedDataParallel(
model,
device_ids=[local_rank],
find_unused_parameters=True,
output_device=local_rank
)
#!
Wrap it with DDP so Pytorch handles multi-GPU
synchronization and data parallelism
#!
model
The model aleady moved to the local GPU
#!
device_ids=[local_rank]
Restrict this process to use only one GPU
#!
find_unused_parameters=True
It tells pyTorch "Some layers in my model might not be used every time I call forward()
-> so please handle that correctly"
The detail please see Usage_model_pressure.py forwar() function

#!
output_device=local_rank
Ensures outputs go to the same GPU as inputs

11.----
criterion = torch.nn.MSELoss()
#!
Loss function:
This sets up Mean Squared Error(MSE) as the loss function, commonly used for regression problems
It measures the average of the squares of the differences between predicted and actual values:
MSE = 1/n * sum((yi - y)^2) i = 1, ... , n

12.----
optimizer = optim.Adam(model.parameters(), lr=args.lr, weight_decay=1e-4)
#!
Uses Adam(Adaptive Moment Estimation), a popular optimizer that adjusts learning rates for each parameter
#!
model.parameter()
->Tell the optimizer which parameters to update
#!
lr = args.lr
->learning rate
#!
weight_decay=1e-4
->adds L2 regularization to reduce overfitting

13.----
scheduler = ReduceLROnPlateau(optimizer, 'min', patience=10, factor=0.1, verbose=True)
#!
Automatically reduces the learning rate when the validation loss plateaus(stops improving)
#!
'min'
->Try to minimize val loss
-> By default 1e-4
#!
patience=10
->Wait for 10 epochs without improvement
#!
factor=0.1
->Multiplies LR by 0.1
#!
e.g.
Epoch 1 - Validation Loss: 0.470
LR : 0.01
Epoch 2 - Validation Loss: 0.471
LR : 0.01
Epoch 3 - Validation Loss: 0.471
LR : 0.01
Epoch 4 - Validation Loss: 0.470
LR : 0.01*0.1

'''




Loading