Commit 52ca3258 authored by Paul Primus's avatar Paul Primus
Browse files

Merge branch 'master' of gitlab.cp.jku.at:paulp/dcase2020_task2

parents 19e134da 59bd6ac4
...@@ -141,18 +141,18 @@ def configuration(): ...@@ -141,18 +141,18 @@ def configuration():
##################### #####################
machine_type = 0 machine_type = 0
machine_id = 2 machine_id = 0
num_mel = 128 num_mel = 128
n_fft = 1024 n_fft = 1024
hop_size = 512 hop_size = 512
power = 2.0 power = 2.0
fmin = 0 fmin = 0
context = 5 context = 32
model_class = 'dcase2020_task2.models.FCNN' model_class = 'dcase2020_task2.models.CNN'
hidden_size = 256 hidden_size = 512
num_hidden = 3 num_hidden = 4
dropout_probability = 0.0 dropout_probability = 0.0
# complement set # complement set
...@@ -162,11 +162,11 @@ def configuration(): ...@@ -162,11 +162,11 @@ def configuration():
if debug: if debug:
num_workers = 0 num_workers = 0
else: else:
num_workers = 3 num_workers = 4
epochs = 100 epochs = 100
loss_class = 'dcase2020_task2.losses.BCE' loss_class = 'dcase2020_task2.losses.BCE'
batch_size = 8192 batch_size = 512
learning_rate = 1e-4 learning_rate = 1e-4
weight_decay = 0 weight_decay = 0
......
...@@ -2,4 +2,4 @@ from dcase2020_task2.models.base_model import ClassifierBase, VAEBase ...@@ -2,4 +2,4 @@ from dcase2020_task2.models.base_model import ClassifierBase, VAEBase
from dcase2020_task2.models.made import MADE from dcase2020_task2.models.made import MADE
from dcase2020_task2.models.ae import AE, ConvAE from dcase2020_task2.models.ae import AE, ConvAE
from dcase2020_task2.models.classifier import FCNN from dcase2020_task2.models.classifier import FCNN, CNN
\ No newline at end of file \ No newline at end of file
...@@ -24,7 +24,7 @@ class FCNN(torch.nn.Module): ...@@ -24,7 +24,7 @@ class FCNN(torch.nn.Module):
activation_fn = activation_dict[activation] activation_fn = activation_dict[activation]
self.input_shape = input_shape self.input_shape = input_shape
sizes = [np.prod(input_shape)] + [hidden_size for _ in range(num_hidden)] + [num_outputs] sizes = [np.prod(input_shape)] + [hidden_size for i in range(num_hidden)] + [num_outputs]
layers = [] layers = []
for i, o in zip(sizes[:-1], sizes[1:]): for i, o in zip(sizes[:-1], sizes[1:]):
layers.append(torch.nn.Linear(i, o)) layers.append(torch.nn.Linear(i, o))
...@@ -46,4 +46,45 @@ class FCNN(torch.nn.Module): ...@@ -46,4 +46,45 @@ class FCNN(torch.nn.Module):
x = batch['observations'] x = batch['observations']
x = x.view(x.shape[0], -1) x = x.view(x.shape[0], -1)
batch['scores'] = self.clf(x) batch['scores'] = self.clf(x)
return batch
class CNN(torch.nn.Module):
def __init__(
self,
input_shape,
hidden_size=256,
num_hidden=3,
num_outputs=1,
activation='relu',
batch_norm=False,
dropout_probability=0.1
):
super().__init__()
activation_fn = activation_dict[activation]
self.input_shape = input_shape
sizes = [input_shape[0]] + [hidden_size for i in range(num_hidden)] + [num_outputs]
layers = []
for i, o in zip(sizes[:-1], sizes[1:]):
layers.append(torch.nn.Conv2d(i, o, kernel_size=(3, 3), stride=2, padding=(1, 1)))
# layers.append(torch.nn.Dropout(p=dropout_probability))
layers.append(activation_fn())
_ = layers.pop()
layers.append(torch.nn.AdaptiveMaxPool2d(1))
# _ = layers.pop()
if batch_norm:
_ = layers.pop()
self.clf = torch.nn.Sequential(*layers)
self.apply(init_weights)
def forward(self, batch):
x = batch['observations']
batch['scores'] = self.clf(x).view(-1, 1)
return batch return batch
\ No newline at end of file
conda activate dcase2020_task2
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.BCE -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
\ No newline at end of file
conda activate dcase2020_task2
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=3 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=3 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=4 hidden_size=256 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
./scripts/run_all.sh classification_experiment 0 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 1 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=0 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 2 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-4 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
./scripts/run_all.sh classification_experiment 3 "debug=False num_hidden=4 hidden_size=512 batch_size=512 learning_rate=1e-5 weight_decay=1e-5 model_class=dcase2020_task2.models.CNN loss_class=dcase2020_task2.losses.AUC -m student2.cp.jku.at:27017:dcase2020_task2_conv_complement_classification_gridsearch" &
wait
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment