Skip to content

Commit

Permalink
Started full downstream training
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Joeres authored and Roman Joeres committed Aug 19, 2024
1 parent 1436cd0 commit 082d7e8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 50 deletions.
96 changes: 48 additions & 48 deletions configs/downstream/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ datasets:
task: classification
- name: Taxonomy_Domain
task: multilabel
#- name: Taxonomy_Kingdom
# task: multilabel
#- name: Taxonomy_Phylum
# task: multilabel
#- name: Taxonomy_Class
# task: multilabel
#- name: Taxonomy_Order
# task: multilabel
#- name: Taxonomy_Family
# task: multilabel
#- name: Taxonomy_Genus
# task: multilabel
#- name: Taxonomy_Species
# task: multilabel
- name: Taxonomy_Kingdom
task: multilabel
- name: Taxonomy_Phylum
task: multilabel
- name: Taxonomy_Class
task: multilabel
- name: Taxonomy_Order
task: multilabel
- name: Taxonomy_Family
task: multilabel
- name: Taxonomy_Genus
task: multilabel
- name: Taxonomy_Species
task: multilabel
pre-transforms:
model:
#- name: rf
# n_estimators: 500
# n_jobs: -1
# random_state: 42
#- name: svm
# random_state: 42
#- name: xgb
# random_state: 42
- name: rf
n_estimators: 500
n_jobs: -1
random_state: 42
- name: svm
random_state: 42
- name: xgb
random_state: 42
- name: mlp
hidden_dim: 1024
batch_size: 256
Expand All @@ -41,29 +41,29 @@ model:
patience: 30
learning_rate: 0
optimizer: Adam
#- name: sweetnet
# hidden_dim: 1024
# batch_size: 512
# num_layers: 16
# epochs: 1
# patience: 30
# learning_rate: 0.001
# optimizer: Adam
# suffix:
#- name: gnngly
# hidden_dim: 1024
# batch_size: 512
# num_layers: 8
# epochs: 1
# patience: 30
# learning_rate: 0.001
# optimizer: Adam
# suffix:
#- name: gifflar
# hidden_dim: 1024
# batch_size: 256
# num_layers: 8
# epochs: 100
# learning_rate: 0.001
# optimizer: Adam
# suffix:
- name: sweetnet
hidden_dim: 1024
batch_size: 512
num_layers: 16
epochs: 100
patience: 30
learning_rate: 0.001
optimizer: Adam
suffix:
- name: gnngly
hidden_dim: 1024
batch_size: 512
num_layers: 8
epochs: 100
patience: 30
learning_rate: 0.001
optimizer: Adam
suffix:
- name: gifflar
hidden_dim: 1024
batch_size: 256
num_layers: 8
epochs: 100
learning_rate: 0.001
optimizer: Adam
suffix:
2 changes: 2 additions & 0 deletions gifflar/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ def __init__(self, threshold=0.5, dist_sync_on_step=False, **kwargs):
self.add_state("false_negatives", default=torch.tensor(0), dist_reduce_fx="sum")

def update(self, preds: torch.Tensor, target: torch.Tensor):
print(preds.shape)
print(target.shape)
preds = (preds > self.threshold).int()
target = target.int()

Expand Down
4 changes: 2 additions & 2 deletions gifflar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sklearn.svm import LinearSVR, SVC, SVR
from torchmetrics import MetricCollection, Accuracy, AUROC, MatthewsCorrCoef, MeanAbsoluteError, MeanSquaredError, \
R2Score
from gifflar.metrics import Sensitivity
from gifflar.sensitivity import Sensitivity


# MASK: +1 | Other: +2 => len(...) | len(...) + 1
Expand Down Expand Up @@ -116,7 +116,7 @@ def get_metrics(
Accuracy(**metric_args),
AUROC(**metric_args),
MatthewsCorrCoef(**metric_args),
# Sensitivity(**metric_args),
Sensitivity(**metric_args),
])
return {"train": m.clone(prefix="train/"), "val": m.clone(prefix="val/"), "test": m.clone(prefix="test/")}

Expand Down

0 comments on commit 082d7e8

Please sign in to comment.