Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paul Primus
dcase2020_task2
Commits
44344105
Commit
44344105
authored
Jun 09, 2020
by
Paul Primus
Browse files
add RK3 traning script
parent
bd423e3e
Changes
8
Hide whitespace changes
Inline
Side-by-side
dcase2020_task2/experiments/classification_experiment.py
View file @
44344105
...
...
@@ -141,18 +141,18 @@ def configuration():
#####################
machine_type
=
0
machine_id
=
2
machine_id
=
0
num_mel
=
128
n_fft
=
1024
hop_size
=
512
power
=
2.0
fmin
=
0
context
=
5
context
=
32
model_class
=
'dcase2020_task2.models.
F
CNN'
hidden_size
=
256
num_hidden
=
3
model_class
=
'dcase2020_task2.models.CNN'
hidden_size
=
512
num_hidden
=
4
dropout_probability
=
0.0
# complement set
...
...
@@ -162,11 +162,11 @@ def configuration():
if
debug
:
num_workers
=
0
else
:
num_workers
=
3
num_workers
=
4
epochs
=
100
loss_class
=
'dcase2020_task2.losses.BCE'
batch_size
=
819
2
batch_size
=
51
2
learning_rate
=
1e-4
weight_decay
=
0
...
...
dcase2020_task2/models/__init__.py
View file @
44344105
...
...
@@ -2,4 +2,4 @@ from dcase2020_task2.models.base_model import ClassifierBase, VAEBase
from
dcase2020_task2.models.made
import
MADE
from
dcase2020_task2.models.ae
import
AE
,
ConvAE
from
dcase2020_task2.models.classifier
import
FCNN
\ No newline at end of file
from
dcase2020_task2.models.classifier
import
FCNN
,
CNN
\ No newline at end of file
dcase2020_task2/models/classifier.py
View file @
44344105
...
...
@@ -24,7 +24,7 @@ class FCNN(torch.nn.Module):
activation_fn
=
activation_dict
[
activation
]
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
=
[]
for
i
,
o
in
zip
(
sizes
[:
-
1
],
sizes
[
1
:]):
layers
.
append
(
torch
.
nn
.
Linear
(
i
,
o
))
...
...
@@ -46,4 +46,45 @@ class FCNN(torch.nn.Module):
x
=
batch
[
'observations'
]
x
=
x
.
view
(
x
.
shape
[
0
],
-
1
)
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
\ No newline at end of file
scripts/convolutional_classification/convolutional_complement_rk0.sh
0 → 100755
View file @
44344105
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=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
./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
\ No newline at end of file
scripts/classification/complement_rk0.sh
→
scripts/
flat_
classification/complement_rk0.sh
View file @
44344105
File moved
scripts/classification/complement_rk3.sh
→
scripts/
flat_
classification/complement_rk3.sh
View file @
44344105
File moved
scripts/classification/complement_rk6.sh
→
scripts/
flat_
classification/complement_rk6.sh
View file @
44344105
File moved
scripts/classification/complement_rk7.sh
→
scripts/
flat_
classification/complement_rk7.sh
View file @
44344105
File moved
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment