parent
048c3fab26
commit
12c9b0ea35
6 changed files with 855 additions and 25 deletions
@ -0,0 +1,612 @@ |
||||
# |
||||
# This prototxt is based on voc-fcn8s/val.prototxt file from |
||||
# https://github.com/shelhamer/fcn.berkeleyvision.org, which is distributed under |
||||
# Caffe (BSD) license: |
||||
# http://caffe.berkeleyvision.org/model_zoo.html#bvlc-model-license |
||||
# |
||||
name: "voc-fcn8s" |
||||
input: "data" |
||||
input_dim: 1 |
||||
input_dim: 3 |
||||
input_dim: 500 |
||||
input_dim: 500 |
||||
layer { |
||||
name: "conv1_1" |
||||
type: "Convolution" |
||||
bottom: "data" |
||||
top: "conv1_1" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 64 |
||||
pad: 100 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu1_1" |
||||
type: "ReLU" |
||||
bottom: "conv1_1" |
||||
top: "conv1_1" |
||||
} |
||||
layer { |
||||
name: "conv1_2" |
||||
type: "Convolution" |
||||
bottom: "conv1_1" |
||||
top: "conv1_2" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 64 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu1_2" |
||||
type: "ReLU" |
||||
bottom: "conv1_2" |
||||
top: "conv1_2" |
||||
} |
||||
layer { |
||||
name: "pool1" |
||||
type: "Pooling" |
||||
bottom: "conv1_2" |
||||
top: "pool1" |
||||
pooling_param { |
||||
pool: MAX |
||||
kernel_size: 2 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "conv2_1" |
||||
type: "Convolution" |
||||
bottom: "pool1" |
||||
top: "conv2_1" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 128 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu2_1" |
||||
type: "ReLU" |
||||
bottom: "conv2_1" |
||||
top: "conv2_1" |
||||
} |
||||
layer { |
||||
name: "conv2_2" |
||||
type: "Convolution" |
||||
bottom: "conv2_1" |
||||
top: "conv2_2" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 128 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu2_2" |
||||
type: "ReLU" |
||||
bottom: "conv2_2" |
||||
top: "conv2_2" |
||||
} |
||||
layer { |
||||
name: "pool2" |
||||
type: "Pooling" |
||||
bottom: "conv2_2" |
||||
top: "pool2" |
||||
pooling_param { |
||||
pool: MAX |
||||
kernel_size: 2 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "conv3_1" |
||||
type: "Convolution" |
||||
bottom: "pool2" |
||||
top: "conv3_1" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 256 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu3_1" |
||||
type: "ReLU" |
||||
bottom: "conv3_1" |
||||
top: "conv3_1" |
||||
} |
||||
layer { |
||||
name: "conv3_2" |
||||
type: "Convolution" |
||||
bottom: "conv3_1" |
||||
top: "conv3_2" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 256 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu3_2" |
||||
type: "ReLU" |
||||
bottom: "conv3_2" |
||||
top: "conv3_2" |
||||
} |
||||
layer { |
||||
name: "conv3_3" |
||||
type: "Convolution" |
||||
bottom: "conv3_2" |
||||
top: "conv3_3" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 256 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu3_3" |
||||
type: "ReLU" |
||||
bottom: "conv3_3" |
||||
top: "conv3_3" |
||||
} |
||||
layer { |
||||
name: "pool3" |
||||
type: "Pooling" |
||||
bottom: "conv3_3" |
||||
top: "pool3" |
||||
pooling_param { |
||||
pool: MAX |
||||
kernel_size: 2 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "conv4_1" |
||||
type: "Convolution" |
||||
bottom: "pool3" |
||||
top: "conv4_1" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 512 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu4_1" |
||||
type: "ReLU" |
||||
bottom: "conv4_1" |
||||
top: "conv4_1" |
||||
} |
||||
layer { |
||||
name: "conv4_2" |
||||
type: "Convolution" |
||||
bottom: "conv4_1" |
||||
top: "conv4_2" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 512 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu4_2" |
||||
type: "ReLU" |
||||
bottom: "conv4_2" |
||||
top: "conv4_2" |
||||
} |
||||
layer { |
||||
name: "conv4_3" |
||||
type: "Convolution" |
||||
bottom: "conv4_2" |
||||
top: "conv4_3" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 512 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu4_3" |
||||
type: "ReLU" |
||||
bottom: "conv4_3" |
||||
top: "conv4_3" |
||||
} |
||||
layer { |
||||
name: "pool4" |
||||
type: "Pooling" |
||||
bottom: "conv4_3" |
||||
top: "pool4" |
||||
pooling_param { |
||||
pool: MAX |
||||
kernel_size: 2 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "conv5_1" |
||||
type: "Convolution" |
||||
bottom: "pool4" |
||||
top: "conv5_1" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 512 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu5_1" |
||||
type: "ReLU" |
||||
bottom: "conv5_1" |
||||
top: "conv5_1" |
||||
} |
||||
layer { |
||||
name: "conv5_2" |
||||
type: "Convolution" |
||||
bottom: "conv5_1" |
||||
top: "conv5_2" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 512 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu5_2" |
||||
type: "ReLU" |
||||
bottom: "conv5_2" |
||||
top: "conv5_2" |
||||
} |
||||
layer { |
||||
name: "conv5_3" |
||||
type: "Convolution" |
||||
bottom: "conv5_2" |
||||
top: "conv5_3" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 512 |
||||
pad: 1 |
||||
kernel_size: 3 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu5_3" |
||||
type: "ReLU" |
||||
bottom: "conv5_3" |
||||
top: "conv5_3" |
||||
} |
||||
layer { |
||||
name: "pool5" |
||||
type: "Pooling" |
||||
bottom: "conv5_3" |
||||
top: "pool5" |
||||
pooling_param { |
||||
pool: MAX |
||||
kernel_size: 2 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "fc6" |
||||
type: "Convolution" |
||||
bottom: "pool5" |
||||
top: "fc6" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 4096 |
||||
pad: 0 |
||||
kernel_size: 7 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu6" |
||||
type: "ReLU" |
||||
bottom: "fc6" |
||||
top: "fc6" |
||||
} |
||||
layer { |
||||
name: "fc7" |
||||
type: "Convolution" |
||||
bottom: "fc6" |
||||
top: "fc7" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 4096 |
||||
pad: 0 |
||||
kernel_size: 1 |
||||
stride: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "relu7" |
||||
type: "ReLU" |
||||
bottom: "fc7" |
||||
top: "fc7" |
||||
} |
||||
layer { |
||||
name: "score_fr" |
||||
type: "Convolution" |
||||
bottom: "fc7" |
||||
top: "score_fr" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 21 |
||||
pad: 0 |
||||
kernel_size: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "upscore2" |
||||
type: "Deconvolution" |
||||
bottom: "score_fr" |
||||
top: "upscore2" |
||||
param { |
||||
lr_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 21 |
||||
bias_term: false |
||||
kernel_size: 4 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "score_pool4" |
||||
type: "Convolution" |
||||
bottom: "pool4" |
||||
top: "score_pool4" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 21 |
||||
pad: 0 |
||||
kernel_size: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "score_pool4c" |
||||
type: "Crop" |
||||
bottom: "score_pool4" |
||||
bottom: "upscore2" |
||||
top: "score_pool4c" |
||||
crop_param { |
||||
axis: 2 |
||||
offset: 5 |
||||
} |
||||
} |
||||
layer { |
||||
name: "fuse_pool4" |
||||
type: "Eltwise" |
||||
bottom: "upscore2" |
||||
bottom: "score_pool4c" |
||||
top: "fuse_pool4" |
||||
eltwise_param { |
||||
operation: SUM |
||||
} |
||||
} |
||||
layer { |
||||
name: "upscore_pool4" |
||||
type: "Deconvolution" |
||||
bottom: "fuse_pool4" |
||||
top: "upscore_pool4" |
||||
param { |
||||
lr_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 21 |
||||
bias_term: false |
||||
kernel_size: 4 |
||||
stride: 2 |
||||
} |
||||
} |
||||
layer { |
||||
name: "score_pool3" |
||||
type: "Convolution" |
||||
bottom: "pool3" |
||||
top: "score_pool3" |
||||
param { |
||||
lr_mult: 1 |
||||
decay_mult: 1 |
||||
} |
||||
param { |
||||
lr_mult: 2 |
||||
decay_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 21 |
||||
pad: 0 |
||||
kernel_size: 1 |
||||
} |
||||
} |
||||
layer { |
||||
name: "score_pool3c" |
||||
type: "Crop" |
||||
bottom: "score_pool3" |
||||
bottom: "upscore_pool4" |
||||
top: "score_pool3c" |
||||
crop_param { |
||||
axis: 2 |
||||
offset: 9 |
||||
} |
||||
} |
||||
layer { |
||||
name: "fuse_pool3" |
||||
type: "Eltwise" |
||||
bottom: "upscore_pool4" |
||||
bottom: "score_pool3c" |
||||
top: "fuse_pool3" |
||||
eltwise_param { |
||||
operation: SUM |
||||
} |
||||
} |
||||
layer { |
||||
name: "upscore8" |
||||
type: "Deconvolution" |
||||
bottom: "fuse_pool3" |
||||
top: "upscore8" |
||||
param { |
||||
lr_mult: 0 |
||||
} |
||||
convolution_param { |
||||
num_output: 21 |
||||
bias_term: false |
||||
kernel_size: 16 |
||||
stride: 8 |
||||
} |
||||
} |
||||
layer { |
||||
name: "score" |
||||
type: "Crop" |
||||
bottom: "upscore8" |
||||
bottom: "data" |
||||
top: "score" |
||||
crop_param { |
||||
axis: 2 |
||||
offset: 31 |
||||
} |
||||
} |
@ -0,0 +1,146 @@ |
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#include "../precomp.hpp" |
||||
#include "layers_common.hpp" |
||||
#include "eltwise_layer.hpp" |
||||
|
||||
namespace cv |
||||
{ |
||||
namespace dnn |
||||
{ |
||||
EltwiseLayer::EltwiseLayer(LayerParams ¶ms) : Layer(params) |
||||
{ |
||||
if (params.has("operation")) |
||||
{ |
||||
String operation = params.get<String>("operation").toLowerCase(); |
||||
if (operation == "prod") |
||||
op = PROD; |
||||
else if (operation == "sum") |
||||
op = SUM; |
||||
else if (operation == "max") |
||||
op = MAX; |
||||
else |
||||
CV_Error(cv::Error::StsBadArg, "Unknown operaticon type \"" + operation + "\""); |
||||
} |
||||
else |
||||
{ |
||||
op = SUM; |
||||
} |
||||
|
||||
if (params.has("coeff")) |
||||
{ |
||||
DictValue paramCoeff = params.get("coeff"); |
||||
coeffs.resize(paramCoeff.size(), 1); |
||||
for (int i = 0; i < paramCoeff.size(); i++) |
||||
{ |
||||
coeffs[i] = paramCoeff.get<int>(i); |
||||
} |
||||
} |
||||
} |
||||
|
||||
void EltwiseLayer::allocate(const std::vector<Blob *> &inputs, std::vector<Blob> &outputs) |
||||
{ |
||||
CV_Assert(2 <= inputs.size()); |
||||
CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size()); |
||||
CV_Assert(op == SUM || coeffs.size() == 0); |
||||
|
||||
const BlobShape &shape0 = inputs[0]->shape(); |
||||
for (size_t i = 1; i < inputs.size(); ++i) |
||||
{ |
||||
CV_Assert(shape0 == inputs[i]->shape()); |
||||
} |
||||
outputs.resize(1); |
||||
outputs[0].create(shape0); |
||||
} |
||||
|
||||
void EltwiseLayer::forward(std::vector<Blob *> &inputs, std::vector<Blob> &outputs) |
||||
{ |
||||
switch (op) |
||||
{ |
||||
case SUM: |
||||
{ |
||||
CV_Assert(coeffs.size() == 0 || coeffs.size() == inputs.size()); |
||||
Mat& output = outputs[0].matRef(); |
||||
output.setTo(0.); |
||||
if (0 < coeffs.size()) |
||||
{ |
||||
for (size_t i = 0; i < inputs.size(); i++) |
||||
{ |
||||
output += inputs[i]->matRefConst() * coeffs[i]; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
for (size_t i = 0; i < inputs.size(); i++) |
||||
{ |
||||
output += inputs[i]->matRefConst(); |
||||
} |
||||
} |
||||
} |
||||
break; |
||||
case PROD: |
||||
{ |
||||
Mat& output = outputs[0].matRef(); |
||||
output.setTo(1.); |
||||
for (size_t i = 0; i < inputs.size(); i++) |
||||
{ |
||||
output = output.mul(inputs[i]->matRefConst()); |
||||
} |
||||
} |
||||
break; |
||||
case MAX: |
||||
{ |
||||
Mat& output = outputs[0].matRef(); |
||||
cv::max(inputs[0]->matRefConst(), inputs[1]->matRefConst(), output); |
||||
for (size_t i = 2; i < inputs.size(); i++) |
||||
{ |
||||
cv::max(output, inputs[i]->matRefConst(), output); |
||||
} |
||||
} |
||||
break; |
||||
default: |
||||
CV_Assert(0); |
||||
break; |
||||
}; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,68 @@ |
||||
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||
//
|
||||
// By downloading, copying, installing or using the software you agree to this license.
|
||||
// If you do not agree to this license, do not download, install,
|
||||
// copy or use the software.
|
||||
//
|
||||
//
|
||||
// License Agreement
|
||||
// For Open Source Computer Vision Library
|
||||
//
|
||||
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
|
||||
// Third party copyrights are property of their respective owners.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistribution's of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// This software is provided by the copyright holders and contributors "as is" and
|
||||
// any express or implied warranties, including, but not limited to, the implied
|
||||
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||
// In no event shall the Intel Corporation or contributors be liable for any direct,
|
||||
// indirect, incidental, special, exemplary, or consequential damages
|
||||
// (including, but not limited to, procurement of substitute goods or services;
|
||||
// loss of use, data, or profits; or business interruption) however caused
|
||||
// and on any theory of liability, whether in contract, strict liability,
|
||||
// or tort (including negligence or otherwise) arising in any way out of
|
||||
// the use of this software, even if advised of the possibility of such damage.
|
||||
//
|
||||
//M*/
|
||||
|
||||
#ifndef __OPENCV_DNN_LAYERS_ELTWISE_LAYER_HPP__ |
||||
#define __OPENCV_DNN_LAYERS_ELTWISE_LAYER_HPP__ |
||||
#include "../precomp.hpp" |
||||
|
||||
namespace cv |
||||
{ |
||||
namespace dnn |
||||
{ |
||||
class EltwiseLayer : public Layer |
||||
{ |
||||
enum EltwiseOp |
||||
{ |
||||
PROD = 0, |
||||
SUM = 1, |
||||
MAX = 2, |
||||
}; |
||||
|
||||
EltwiseOp op; |
||||
std::vector<int> coeffs; |
||||
public: |
||||
EltwiseLayer(LayerParams& params); |
||||
void allocate(const std::vector<Blob*> &inputs, std::vector<Blob> &outputs); |
||||
void forward(std::vector<Blob*> &inputs, std::vector<Blob> &outputs); |
||||
}; |
||||
} |
||||
} |
||||
#endif |
Loading…
Reference in new issue