Example models
This page lists a variety of example models. Shown are the model toml files
that can be used with the orcanet.model_builder.ModelBuilder
class. You can find more examples over on git:
https://git.km3net.de/ml/OrcaNet/-/tree/master/examples/model_files
Convolutional network
1# A simple sequential network, featuring 2D convolutions, batchnorms, and
2# pooling layers, as well as a categorical output
3[model]
4type = "ConvBlock"
5conv_dim = 2
6kernel_size = 3
7activation = 'relu'
8batchnorm=true
9
10blocks = [
11 {filters=64},
12 {filters=64, pool_size=[2, 2]},
13 {filters=128},
14 {filters=128, pool_size=[2, 2]},
15 {filters=256},
16 {filters=256, pool_size=[2, 2]},
17 {filters=512},
18 {filters=512},
19 {type="OutputCateg", transition="keras:GlobalAveragePooling2D", output_name="your_output_name_here", categories=3}
20]
21
22# ----------------------------------------------------------------------
23[compile]
24optimizer = "adam"
25
26[compile.losses]
27your_output_name_here = {function="categorical_crossentropy", metrics=['acc']}
ResNet
1# An implementation featuring ResNet blocks, with shortcuts. A resnet block
2# consists out of 2 convolutional blocks.
3[model]
4type = "ResnetBlock"
5conv_dim = 2
6kernel_size = 3
7activation = 'relu'
8batchnorm=true
9
10blocks = [
11 {filters=64},
12 {filters=64},
13 {filters=128, strides=[2, 2]},
14 {filters=128},
15 {filters=256, strides=[2, 2]},
16 {filters=256},
17 {filters=512, strides=[2, 2]},
18 {filters=512},
19 {type="OutputCateg", transition="keras:GlobalAveragePooling2D", output_name="your_output_name_here", categories=3}
20]
21
22# ----------------------------------------------------------------------
23[compile]
24optimizer = "sgd"
25
26[compile.losses]
27your_output_name_here = {function="categorical_crossentropy", metrics=['acc']}
Inception network
1# A small network to showcase the use of Inception blocks.
2[model]
3type="InceptionBlockV2"
4conv_dim = 2
5activation = 'relu'
6batchnorm = true
7
8blocks = [
9 {filters_1x1=64, filters_pool=64, filters_3x3=[48, 64], filters_3x3dbl=[64, 96], strides=2},
10 {filters_1x1=64, filters_pool=64, filters_3x3=[48, 64], filters_3x3dbl=[64, 96]},
11 {type="OutputReg", output_name="your_output_name_here", output_neurons=3}
12]
13
14# ----------------------------------------------------------------------
15[compile]
16optimizer = "adam"
17
18[compile.losses]
19your_output_name_here = {function="categorical_crossentropy", metrics=['acc']}
Convolutional + LSTM network
1# A small convoutinal lstm network.
2[model]
3conv_dim = 2
4kernel_size = 3
5
6blocks = [
7 # here, input should be 3 dimensional, time on first axis!
8 {type="ConvBlock", filters=32, time_distributed=true},
9 {type="ConvBlock", filters=32, time_distributed=true, pool_type="global_average_pooling"},
10 # starting a layer block type with 'keras:' allows access to default keras layers
11 {type="keras:LSTM", units=10},
12 {type="OutputReg", output_name='direction_xyz', transition=false, output_neurons=3}
13]
14
15# ----------------------------------------------------------------------
16[compile]
17optimizer = "adam"
18
19[compile.losses]
20direction_xyz = {function="mse"}