Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/deephealthproject/eddl i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
RParedesPalacios committed Jan 26, 2021
2 parents c933d30 + 74ffe85 commit ba43ddc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions examples/nn/4_NLP/4_nlp_video_to_labels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ int main(int argc, char **argv) {
layer in = Input({10, 3, size, size});
layer l=in;
l = Permute(l, {1, 0, 2, 3}); // Conv3D expects (B,C,dim1,dim2,dim3)
l=MaxPool3D(ReLu(Conv3D(l,4,{3, 3, 3},{1, 1, 1}, "same")),{2, 2, 2}, {2, 2, 2}, "same");
l=MaxPool3D(ReLu(Conv3D(l,8,{3, 3, 3},{1, 1, 1}, "same")),{2, 2, 2}, {2, 2, 2}, "same");
l=MaxPool3D(ReLu(Conv3D(l,16,{3, 3, 3},{1, 1, 1}, "same")),{2, 2, 2}, {2, 2, 2}, "same");
l=MaxPool3D(ReLu(Conv3D(l,4,{1, 3, 3},{1, 1, 1}, "same")),{1, 2, 2}, {1, 2, 2}, "same");
l=MaxPool3D(ReLu(Conv3D(l,8,{1, 3, 3},{1, 1, 1}, "same")),{1, 2, 2}, {1, 2, 2}, "same");
l=MaxPool3D(ReLu(Conv3D(l,16,{1, 3, 3},{1, 1, 1}, "same")),{1, 2, 2}, {1, 2, 2}, "same");
l=GlobalMaxPool3D(l);
l = Reshape(l, {-1});
l = LSTM(l, 128);
l = Dense(l, 100);
l = ReLu(l);
l=Squeeze(l);
// l = Reshape(l, {10, -1});
// l = LSTM(l, 128);
// l = Dense(l, 100);
// l = ReLu(l);
l = Dense(l, 2);
layer out = ReLu(l);
model deepVO = Model({in},{out});
Expand All @@ -54,7 +55,7 @@ int main(int argc, char **argv) {

// 32 samples that are sequences of 10 RGB images of 256x256. Target 2 values per image, a sequence as well
Tensor* seqImages = Tensor::randu({32, 10, 3, size, size});
Tensor* seqLabels = Tensor::randu({32, 10, 2});
Tensor* seqLabels = Tensor::randu({32, 2});


fit(deepVO, {seqImages}, {seqLabels}, 4, 10);
Expand Down

0 comments on commit ba43ddc

Please sign in to comment.