Skip to content

Commit

Permalink
merge deformation/non deformation into one class
Browse files Browse the repository at this point in the history
  • Loading branch information
ngbountos committed Jul 3, 2023
1 parent eb6180d commit 69df409
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions configs/supervised_configs.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"wandb_project":"YOUR_PROJECT",
"wandb_project":"YOUR_WANDB_PROJECT",
"wandb_entity":"YOUR_ENTITY",
"task":"classification",
"num_classes":11,
"num_classes":10,
"wandb":true,
"mixed_precision":true,
"ssl_encoder":null, // SSL encoder to finetune. Otherwise null
"ssl_encoder":null,// SSL encoder to finetune. Otherwise null
"ssl_config_path":null, // Config file of the ssl method if finetuning. Otherwise null
"annotation_path":"YOUR_PATH/annotations/", // Full annotation path
"data_path":"YOUR_PATH/Hephaestus_Raw/", // Raw data path.
"batch_size":128,
"annotation_path":"YOUR_ANNOTATION_PATH/annotations/", // Full annotation path
"data_path":"YOUR_DATA_PATH/Hephaestus_Raw/", // Raw data path.
"batch_size":64,
"num_workers":4,
"device":"cuda:1",
"lr":0.0001,
"weight_decay":1e-4,
"epochs":1,
"lr": 1e-4, // SSL lr: 0.00001,
"weight_decay":0,
"epochs":10,
"architecture":"ResNet50",
"oversampling":true, // Oversampling at training time
"multilabel":true, // For metric construction. Training is mainly built for multilabel (TODO make it more generic)
"linear_evaluation":true, // Whether to use the linear evaluation protocol
"augment":false, // wheter to augment for supervised training (TODO)
"metric_strategy":"none", //none to get per class metrics
"num_channel":2, // number of channels, 1 for the phase and one for the coherence
"image_size":224, // How to resize the frame.
"image_size":560, // How to resize the frame.
"test_frames": ["124D_04854_171313", "022D_04826_121209", "087D_07004_060904","174A_09133_131313","021D_09150_131313","109D_05390_141615", "162A_06192_060402", "076D_09725_121107","115D_04999_131313","152D_08915_131313", "164A_13146_131313","151D_SM_REUN_S4","144A_SM_REUN_S6"] // Volcanoes in Campi Flegrei (Italy), Kilauea (Hawaii), Mauna Loa (Hawaii), Puu Ooo (Hawaii), Nyiragongo (Congo), Santorini (Greece), Caldera de los Marteles (Spain/Africa), Merapi (Indonesia), Korosi (Kenya), Silali (Kenya), Cerro Tronador (Chile), Osorno (Chile), Puyehue (Chile), La Soufriere (Carribean)
}
22 changes: 11 additions & 11 deletions dataset/Dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,33 +341,33 @@ def create_label_vector(self,annotation):
# - Deformation, No Deformation
# --- Deformation Type: Mogi, Dyke, Sill, Earthquake
# --- Deformation Intensity
label = np.zeros((11,))
label = np.zeros((10,))
if 'Non_Deformation' in annotation['label']:
label[1] = 1
label[0] = 0
return label
else:
label[0] = 1
# Check activity type. It's possible to have more than one
if 'Mogi' in annotation['activity_type']:
label[2] = 1
label[1] = 1
if 'Dyke' in annotation['activity_type']:
label[3] = 1
label[2] = 1
if 'Sill' in annotation['activity_type']:
label[4] = 1
label[3] = 1
if 'Spheroid' in annotation['activity_type']:
label[5] = 1
label[4] = 1
if 'Earthquake' in annotation['activity_type']:
label[6] = 1
label[5] = 1
if 'Unidentified' in annotation['activity_type']:
label[7] = 1
label[6] = 1

# Check event intensity
if 'Low' in annotation['intensity_level']:
label[8] = 1
label[7] = 1
if 'Medium' in annotation['intensity_level']:
label[9] = 1
label[8] = 1
if 'High' in annotation['intensity_level']:
label[10] = 1
label[9] = 1

return label

Expand Down

0 comments on commit 69df409

Please sign in to comment.