Safetynet.emadl 916 Bytes
Newer Older
1
2
3
component Safetynet{
    ports in Z(0:255)^{3, 210, 280} data,
         out Q(0:1)^{2,1,1} predictions;
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

    implementation CNN {

        def conv(kernel, channels, hasPool=true, convStride=(1,1)){
            Convolution(kernel=kernel, channels=channels, stride=convStride) ->
            Relu() ->
            Pooling(pool_type="max", kernel=(3,3), stride=(2,2), ?=hasPool)
        }
        def fc(){
            FullyConnected(units=4096) ->
            Relu() ->
            Dropout()
        }

        image ->
        conv(kernel=(11,11), channels=96, convStride=(4,4)) ->
        conv(kernel=(5,5), channels=256, convStride=(4,4)) ->
        conv(kernel=(3,3), channels=384, hasPool=false) ->
        conv(kernel=(3,3), channels=384, hasPool=false) ->
        conv(kernel=(3,3), channels=256) ->
        fc() ->
        fc() ->
26
27
        FullyConnected(units=2) ->
	Softmax() ->
28
29
30
31
        predictions

    }
}