Upload 5 files
#1
by
guanwencan - opened
- configs/__init__.py +27 -0
- configs/default.json +47 -0
- configs/fast_train.json +25 -0
- configs/large.json +52 -0
- configs/lightweight.json +25 -0
configs/__init__.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def load_config(config_name='default'):
|
| 6 |
+
config_dir = os.path.dirname(os.path.abspath(__file__))
|
| 7 |
+
config_path = os.path.join(config_dir, f'{config_name}.json')
|
| 8 |
+
|
| 9 |
+
with open(config_path, 'r') as f:
|
| 10 |
+
config = json.load(f)
|
| 11 |
+
|
| 12 |
+
return config
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def get_model_config(config_name='default'):
|
| 16 |
+
config = load_config(config_name)
|
| 17 |
+
return config.get('model', {})
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def get_training_config(config_name='default'):
|
| 21 |
+
config = load_config(config_name)
|
| 22 |
+
return config.get('training', {})
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def get_loss_weights(config_name='default'):
|
| 26 |
+
config = load_config(config_name)
|
| 27 |
+
return config.get('loss_weights', {})
|
configs/default.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"input_dim": 5,
|
| 4 |
+
"output_dim": 72,
|
| 5 |
+
"hidden_dims": [128, 256, 256, 128],
|
| 6 |
+
"dropout": 0.2,
|
| 7 |
+
"n_heads": 8,
|
| 8 |
+
"n_layers": 4
|
| 9 |
+
},
|
| 10 |
+
"training": {
|
| 11 |
+
"epochs": 300,
|
| 12 |
+
"batch_size": 8,
|
| 13 |
+
"learning_rate": 0.001,
|
| 14 |
+
"weight_decay": 0.0001,
|
| 15 |
+
"patience": 50
|
| 16 |
+
},
|
| 17 |
+
"loss_weights": {
|
| 18 |
+
"data": 1.0,
|
| 19 |
+
"physics": 0.5,
|
| 20 |
+
"smooth": 0.1,
|
| 21 |
+
"damage": 0.3,
|
| 22 |
+
"mogi_coulomb": 0.2,
|
| 23 |
+
"regularization": 0.0001
|
| 24 |
+
},
|
| 25 |
+
"damage_params": {
|
| 26 |
+
"freeze_thaw": {
|
| 27 |
+
"a1": 0.002,
|
| 28 |
+
"b1": 1.0,
|
| 29 |
+
"c1": 0.02
|
| 30 |
+
},
|
| 31 |
+
"chemical": {
|
| 32 |
+
"a2": 0.01,
|
| 33 |
+
"b2": 1.5
|
| 34 |
+
},
|
| 35 |
+
"thermal": {
|
| 36 |
+
"T0": 100.0,
|
| 37 |
+
"a3": 0.0003,
|
| 38 |
+
"b3": 1.2
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"data": {
|
| 42 |
+
"train_ratio": 0.64,
|
| 43 |
+
"val_ratio": 0.16,
|
| 44 |
+
"test_ratio": 0.20,
|
| 45 |
+
"random_seed": 42
|
| 46 |
+
}
|
| 47 |
+
}
|
configs/fast_train.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"input_dim": 5,
|
| 4 |
+
"output_dim": 72,
|
| 5 |
+
"hidden_dims": [64, 128, 128, 64],
|
| 6 |
+
"dropout": 0.1,
|
| 7 |
+
"n_heads": 4,
|
| 8 |
+
"n_layers": 2
|
| 9 |
+
},
|
| 10 |
+
"training": {
|
| 11 |
+
"epochs": 100,
|
| 12 |
+
"batch_size": 16,
|
| 13 |
+
"learning_rate": 0.001,
|
| 14 |
+
"weight_decay": 0.0001,
|
| 15 |
+
"patience": 20
|
| 16 |
+
},
|
| 17 |
+
"loss_weights": {
|
| 18 |
+
"data": 1.0,
|
| 19 |
+
"physics": 0.3,
|
| 20 |
+
"smooth": 0.1,
|
| 21 |
+
"damage": 0.2,
|
| 22 |
+
"mogi_coulomb": 0.1,
|
| 23 |
+
"regularization": 0.0001
|
| 24 |
+
}
|
| 25 |
+
}
|
configs/large.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"input_dim": 5,
|
| 4 |
+
"output_dim": 72,
|
| 5 |
+
"hidden_dims": [256, 512, 512, 256],
|
| 6 |
+
"dropout": 0.3,
|
| 7 |
+
"n_heads": 16,
|
| 8 |
+
"n_layers": 6
|
| 9 |
+
},
|
| 10 |
+
"training": {
|
| 11 |
+
"epochs": 500,
|
| 12 |
+
"batch_size": 4,
|
| 13 |
+
"learning_rate": 0.0005,
|
| 14 |
+
"weight_decay": 0.001,
|
| 15 |
+
"patience": 100
|
| 16 |
+
},
|
| 17 |
+
"loss_weights": {
|
| 18 |
+
"data": 1.0,
|
| 19 |
+
"physics": 0.8,
|
| 20 |
+
"smooth": 0.15,
|
| 21 |
+
"damage": 0.5,
|
| 22 |
+
"mogi_coulomb": 0.3,
|
| 23 |
+
"regularization": 0.0001
|
| 24 |
+
},
|
| 25 |
+
"damage_params": {
|
| 26 |
+
"freeze_thaw": {
|
| 27 |
+
"a1": 0.002,
|
| 28 |
+
"b1": 1.0,
|
| 29 |
+
"c1": 0.02
|
| 30 |
+
},
|
| 31 |
+
"chemical": {
|
| 32 |
+
"a2": 0.01,
|
| 33 |
+
"b2": 1.5
|
| 34 |
+
},
|
| 35 |
+
"thermal": {
|
| 36 |
+
"T0": 100.0,
|
| 37 |
+
"a3": 0.0003,
|
| 38 |
+
"b3": 1.2
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"data": {
|
| 42 |
+
"train_ratio": 0.64,
|
| 43 |
+
"val_ratio": 0.16,
|
| 44 |
+
"test_ratio": 0.20,
|
| 45 |
+
"random_seed": 42
|
| 46 |
+
},
|
| 47 |
+
"scheduler": {
|
| 48 |
+
"type": "cosine",
|
| 49 |
+
"warmup_epochs": 20,
|
| 50 |
+
"min_lr": 1e-6
|
| 51 |
+
}
|
| 52 |
+
}
|
configs/lightweight.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model": {
|
| 3 |
+
"input_dim": 5,
|
| 4 |
+
"output_dim": 72,
|
| 5 |
+
"hidden_dims": [64, 128, 64],
|
| 6 |
+
"dropout": 0.1,
|
| 7 |
+
"n_heads": 4,
|
| 8 |
+
"n_layers": 2
|
| 9 |
+
},
|
| 10 |
+
"training": {
|
| 11 |
+
"epochs": 50,
|
| 12 |
+
"batch_size": 32,
|
| 13 |
+
"learning_rate": 0.002,
|
| 14 |
+
"weight_decay": 0.0001,
|
| 15 |
+
"patience": 10
|
| 16 |
+
},
|
| 17 |
+
"loss_weights": {
|
| 18 |
+
"data": 1.0,
|
| 19 |
+
"physics": 0.2,
|
| 20 |
+
"smooth": 0.05,
|
| 21 |
+
"damage": 0.1,
|
| 22 |
+
"mogi_coulomb": 0.05,
|
| 23 |
+
"regularization": 0.0001
|
| 24 |
+
}
|
| 25 |
+
}
|