forked from flexflow/flexflow-train
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalexnet.cc
More file actions
19 lines (18 loc) · 671 Bytes
/
alexnet.cc
File metadata and controls
19 lines (18 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "model.h"
void FFModel::add_layers()
{
printf("inputImage.numDim = %d\n", inputImage.numDim);
Tensor t = conv2d("conv1", inputImage, 64, 11, 11, 4, 4, 2, 2);
t = pool2d("pool1", t, 3, 3, 2, 2, 0, 0);
t = conv2d("conv2", t, 192, 5, 5, 1, 1, 2, 2);
t = pool2d("pool2", t, 3, 3, 2, 2, 0, 0);
t = conv2d("conv3", t, 384, 3, 3, 1, 1, 1, 1);
t = conv2d("conv4", t, 256, 3, 3, 1, 1, 1, 1);
t = conv2d("conv5", t, 256, 3, 3, 1, 1, 1, 1);
t = pool2d("pool3", t, 3, 3, 2, 2, 0, 0);
t = flat("flat", t);
t = linear("lienar1", t, 4096);
t = linear("linear2", t, 4096);
t = linear("linear3", t, 1000, false/*relu*/);
t = softmax("softmax", t);
}