platform/upstream/caffe.git
10 years agoMerge pull request #1315 from sergeyk/master
Sergey Karayev [Fri, 17 Oct 2014 18:50:48 +0000 (11:50 -0700)]
Merge pull request #1315 from sergeyk/master

Fixing finetune_flickr_style model reported accuracy.

10 years agoFixing finetune_flickr_style model reported accuracy.
Sergey Karayev [Fri, 17 Oct 2014 18:34:25 +0000 (11:34 -0700)]
Fixing finetune_flickr_style model reported accuracy.

10 years agoMerge pull request #1309 from CellScope/edit-brew-boost-python
Evan Shelhamer [Thu, 16 Oct 2014 20:02:01 +0000 (13:02 -0700)]
Merge pull request #1309 from CellScope/edit-brew-boost-python

Edit boost-python formula for OS X 10.9 compatibility

10 years agoEdit boost-python formula
Daniel Golden [Thu, 16 Oct 2014 19:55:53 +0000 (12:55 -0700)]
Edit boost-python formula

10 years ago[docs] proofreading suggested by @cNikolaou
Evan Shelhamer [Wed, 15 Oct 2014 06:48:38 +0000 (23:48 -0700)]
[docs] proofreading suggested by @cNikolaou

10 years ago[examples] fix reference model name for flickr fine-tuning
Evan Shelhamer [Tue, 14 Oct 2014 17:18:20 +0000 (10:18 -0700)]
[examples] fix reference model name for flickr fine-tuning

10 years ago[docs] pip install harder
Evan Shelhamer [Sat, 11 Oct 2014 07:25:27 +0000 (00:25 -0700)]
[docs] pip install harder

10 years ago[docs] pip install packages in order for dependencies
Evan Shelhamer [Sat, 11 Oct 2014 07:05:57 +0000 (00:05 -0700)]
[docs] pip install packages in order for dependencies

10 years ago[docs] note boost 1.56 an CUDA conflict on OS X
Evan Shelhamer [Fri, 10 Oct 2014 06:59:10 +0000 (23:59 -0700)]
[docs] note boost 1.56 an CUDA conflict on OS X

10 years ago[docs] update homebrew instructions for boost and boost-python split
Evan Shelhamer [Fri, 10 Oct 2014 05:43:36 +0000 (22:43 -0700)]
[docs] update homebrew instructions for boost and boost-python split

10 years ago[example] re-title LeNet / MNIST heading too
Evan Shelhamer [Fri, 10 Oct 2014 04:01:41 +0000 (21:01 -0700)]
[example] re-title LeNet / MNIST heading too

10 years ago[example] add LeNet to MNIST title, fix paths to be from root
Evan Shelhamer [Fri, 10 Oct 2014 04:00:03 +0000 (21:00 -0700)]
[example] add LeNet to MNIST title, fix paths to be from root

10 years ago[example] fix data script paths for flickr fine-tuning
Evan Shelhamer [Thu, 9 Oct 2014 02:56:07 +0000 (19:56 -0700)]
[example] fix data script paths for flickr fine-tuning

10 years agoMerge pull request #1226 from longjon/check-solver-prototxt
Evan Shelhamer [Wed, 8 Oct 2014 16:57:56 +0000 (09:57 -0700)]
Merge pull request #1226 from longjon/check-solver-prototxt

[fix] check solver prototxt parsing

10 years ago[fix] check solver prototxt parsing
Jonathan L Long [Mon, 6 Oct 2014 19:34:18 +0000 (12:34 -0700)]
[fix] check solver prototxt parsing

10 years agoMerge pull request #1198 from dbbert/patch-1
Jonathan L Long [Thu, 2 Oct 2014 18:52:48 +0000 (11:52 -0700)]
Merge pull request #1198 from dbbert/patch-1

10 years agoUpdate detect.py
Bert [Wed, 1 Oct 2014 13:29:24 +0000 (15:29 +0200)]
Update detect.py

This generator causes an error in detect_windows because it is run twice there.
Better store it as a data structure instead.

10 years agoMerge pull request #1203 from jeffdonahue/fix-output-blob-indexing
Jeff Donahue [Wed, 1 Oct 2014 21:46:18 +0000 (14:46 -0700)]
Merge pull request #1203 from jeffdonahue/fix-output-blob-indexing

[fix] solver indexing of output blobs was incorrect for non-singleton outputs

10 years ago[fix] solver indexing of output blobs was incorrect for non-singleton
Jeff Donahue [Wed, 1 Oct 2014 21:19:30 +0000 (14:19 -0700)]
[fix] solver indexing of output blobs was incorrect for non-singleton
outputs

10 years agoMerge pull request #1166 from pluskid/master
Jeff Donahue [Mon, 29 Sep 2014 21:14:50 +0000 (14:14 -0700)]
Merge pull request #1166 from pluskid/master

bugfix: HDF5 layer reshape bug

10 years agofix hdf5 data layer bug
Chiyuan Zhang [Fri, 26 Sep 2014 19:21:57 +0000 (15:21 -0400)]
fix hdf5 data layer bug

10 years agoupdate HDF5 layer test data.
Chiyuan Zhang [Fri, 26 Sep 2014 19:21:45 +0000 (15:21 -0400)]
update HDF5 layer test data.

10 years agotweak test case to expose bug.
Chiyuan Zhang [Fri, 26 Sep 2014 17:18:38 +0000 (13:18 -0400)]
tweak test case to expose bug.

10 years agoMerge pull request #1147 from savy-91/patch-1
Evan Shelhamer [Thu, 25 Sep 2014 03:29:23 +0000 (20:29 -0700)]
Merge pull request #1147 from savy-91/patch-1

Changed "blas" to "openblas"

10 years agoMerge pull request #1152 from sguada/fix_cv_size_order
Evan Shelhamer [Wed, 24 Sep 2014 21:43:35 +0000 (14:43 -0700)]
Merge pull request #1152 from sguada/fix_cv_size_order

Fix param order of cv::Size in cv::resize

10 years agoFixed param order of cv::Size in cv::resize
Sergio [Wed, 24 Sep 2014 21:27:57 +0000 (14:27 -0700)]
Fixed param order of cv::Size in cv::resize

10 years agoChanged "blas" to "openblas"
savy-91 [Tue, 23 Sep 2014 19:57:16 +0000 (21:57 +0200)]
Changed "blas" to "openblas"

The change was made because openblas has to be linked as "-lopenblas" and not "-lblas". This caused an error when compiling.

10 years agoMerge pull request #1128 from shelhamer/default-db-lmdb
Evan Shelhamer [Mon, 22 Sep 2014 05:08:08 +0000 (22:08 -0700)]
Merge pull request #1128 from shelhamer/default-db-lmdb

default to lmdb for database storage

10 years agoswitch examples to lmdb (except for custom data loaders)
Evan Shelhamer [Sun, 21 Sep 2014 22:32:03 +0000 (15:32 -0700)]
switch examples to lmdb (except for custom data loaders)

10 years agofix cifar10 paths so they can be run from caffe root
Jeff Donahue [Fri, 19 Sep 2014 19:38:39 +0000 (12:38 -0700)]
fix cifar10 paths so they can be run from caffe root

10 years agodefault backend to lmdb for image conversion and mean computation
Evan Shelhamer [Sun, 21 Sep 2014 22:20:47 +0000 (15:20 -0700)]
default backend to lmdb for image conversion and mean computation

lmdb is 10-15% faster than leveldb although it takes ~1.1x the storage.
This is usually irrelevant in prefetching since both are fast enough,
but more important lmdb allows multiple, concurrent reads for training
and evaluation several models on the same data.

10 years agoMerge pull request #1126 from shelhamer/window-data-param-upgrade
Sergio Guadarrama [Sun, 21 Sep 2014 20:21:22 +0000 (13:21 -0700)]
Merge pull request #1126 from shelhamer/window-data-param-upgrade

[fix] include WindowDataLayer in data param upgrade

10 years agodefine up-to-date all-in-one model for pascal finetuning
Evan Shelhamer [Sun, 21 Sep 2014 18:38:20 +0000 (11:38 -0700)]
define up-to-date all-in-one model for pascal finetuning

10 years agoload transform params in window data layer
Evan Shelhamer [Sun, 21 Sep 2014 17:29:39 +0000 (10:29 -0700)]
load transform params in window data layer

10 years agoinclude WindowDataLayer in data param upgrade
Evan Shelhamer [Sun, 21 Sep 2014 16:52:51 +0000 (09:52 -0700)]
include WindowDataLayer in data param upgrade

10 years agoMerge pull request #1115 from rickardnorlander/master
Jeff Donahue [Sat, 20 Sep 2014 15:39:14 +0000 (08:39 -0700)]
Merge pull request #1115 from rickardnorlander/master

Fix typo in LRN-expression in docs

10 years agoMerge pull request #1117 from ronghanghu/fix-finetune-example
Evan Shelhamer [Sat, 20 Sep 2014 04:30:51 +0000 (21:30 -0700)]
Merge pull request #1117 from ronghanghu/fix-finetune-example

[fix] set R-CNN fine-tuning PASCAL example paths

10 years agofix directory in finetune pascal example
Ronghang Hu [Fri, 19 Sep 2014 23:55:32 +0000 (07:55 +0800)]
fix directory in finetune pascal example

10 years agoFix typo in LRN-expression in docs
rickardnorlander [Fri, 19 Sep 2014 18:47:44 +0000 (20:47 +0200)]
Fix typo in LRN-expression in docs

This is more consistent with krizhevsky2012, and it seems to be what the code does.

10 years agoMerge pull request #1112 from BVLC/next
Evan Shelhamer [Fri, 19 Sep 2014 05:22:02 +0000 (22:22 -0700)]
Merge pull request #1112 from BVLC/next

Next: release candidate

10 years agorelax precision of gradient-based solver tests
Evan Shelhamer [Fri, 19 Sep 2014 05:07:01 +0000 (22:07 -0700)]
relax precision of gradient-based solver tests

10 years ago[example] groom siamese notebook
Evan Shelhamer [Fri, 19 Sep 2014 03:46:49 +0000 (20:46 -0700)]
[example] groom siamese notebook

10 years agoMerge pull request #959 from nickcarlevaris/contrastive_loss
Evan Shelhamer [Fri, 19 Sep 2014 04:37:31 +0000 (21:37 -0700)]
Merge pull request #959 from nickcarlevaris/contrastive_loss

  Add contrastive loss layer, tests, and a siamese network example

10 years ago[docs] order ipython notebooks
Evan Shelhamer [Fri, 19 Sep 2014 04:25:10 +0000 (21:25 -0700)]
[docs] order ipython notebooks

10 years ago[example] resurrect imagenet training scripts
Evan Shelhamer [Fri, 19 Sep 2014 03:24:19 +0000 (20:24 -0700)]
[example] resurrect imagenet training scripts

10 years ago[model zoo] ignore models -- only for reference or zoo
Evan Shelhamer [Fri, 19 Sep 2014 03:15:50 +0000 (20:15 -0700)]
[model zoo] ignore models -- only for reference or zoo

10 years ago[model zoo] download from gist grooming
Evan Shelhamer [Fri, 19 Sep 2014 03:06:24 +0000 (20:06 -0700)]
[model zoo] download from gist grooming

- invoke by shell
- default download dir to models/
- save to flat dir of owner-gist instead of nested owner/gist

10 years agoMerge pull request #1110 from sergeyk/dev
Evan Shelhamer [Thu, 18 Sep 2014 23:27:52 +0000 (16:27 -0700)]
Merge pull request #1110 from sergeyk/dev

  [model zoo] download gist script

10 years ago[model zoo] download gist script
Sergey Karayev [Thu, 18 Sep 2014 23:11:07 +0000 (16:11 -0700)]
[model zoo] download gist script

10 years agoMerge pull request #594 from longjon/layer-reshaping
Evan Shelhamer [Thu, 18 Sep 2014 20:32:35 +0000 (13:32 -0700)]
Merge pull request #594 from longjon/layer-reshaping

On-the-fly net resizing, without reallocation (where possible)

10 years agocheck that LRN's local_size is odd as the current implementation requires
Jonathan L Long [Fri, 12 Sep 2014 23:07:34 +0000 (16:07 -0700)]
check that LRN's local_size is odd as the current implementation requires

10 years ago[docs] clarify the use of Blob::Reshape a bit
Jonathan L Long [Fri, 12 Sep 2014 22:33:49 +0000 (15:33 -0700)]
[docs] clarify the use of Blob::Reshape a bit

10 years ago[pycaffe] expose Net::Reshape
Jonathan L Long [Fri, 12 Sep 2014 22:23:11 +0000 (15:23 -0700)]
[pycaffe] expose Net::Reshape

10 years agoadd Net::Reshape for only reshaping
Jonathan L Long [Fri, 12 Sep 2014 22:20:52 +0000 (15:20 -0700)]
add Net::Reshape for only reshaping

Note that it is not normally necessary to call this function when using
reshapable nets, but sometimes it can be useful to compute the sizes of
intermediate layers without waiting for the forward pass.

10 years agoinclude Reshape in caffe time
Jonathan L Long [Fri, 12 Sep 2014 21:34:16 +0000 (14:34 -0700)]
include Reshape in caffe time

Since we are now calling Reshape in the Forward pass, it's only fair to
include it when timing. Reshape calls should normally be four or so
orders of magnitude faster than Forward calls; this change also makes it
easy to notice a mistake that causes something slow to happen in
Reshape.

10 years agotest net reshaping
Jonathan L Long [Wed, 2 Jul 2014 19:21:10 +0000 (12:21 -0700)]
test net reshaping

10 years agodefault LayerSetUp to no-op instead of NOT_IMPLEMENTED
Jonathan L Long [Fri, 12 Sep 2014 20:58:10 +0000 (13:58 -0700)]
default LayerSetUp to no-op instead of NOT_IMPLEMENTED

Now that top blobs are set up in Layer::Reshape, it's Reshape that is
mandatory, and simple layers often don't need to implement LayerSetUp.
Reshape is (already) declared abstract, so not implementing it is a
compile-time error.

10 years agocall Reshape in Layer::SetUp
Jonathan L Long [Fri, 12 Sep 2014 20:56:38 +0000 (13:56 -0700)]
call Reshape in Layer::SetUp

Strictly speaking, Reshape doesn't need to be called until the first
Forward call; however, much existing code (especially tests) assumes
that top blobs will be set up in SetUp, so we may as well do it there.

10 years agosplit off Reshape for vision layers
Jonathan L Long [Thu, 11 Sep 2014 06:31:33 +0000 (23:31 -0700)]
split off Reshape for vision layers

Note that we are dropping some checks from LRN layer. However, these
checks are fairly redundant; something is very wrong if these layers
are producing top blobs that are different sizes than their inputs, and
tests are the right place to catch that. The thing that really should be
checked (that isn't) is that that local_size needs to be odd; this will
be added in a future commit.

10 years agosplit off Reshape for common layers
Jonathan L Long [Thu, 11 Sep 2014 05:42:45 +0000 (22:42 -0700)]
split off Reshape for common layers

10 years agosplit off Reshape for neuron layers
Jonathan L Long [Thu, 11 Sep 2014 04:48:51 +0000 (21:48 -0700)]
split off Reshape for neuron layers

10 years agosplit off Reshape for loss layers
Jonathan L Long [Thu, 11 Sep 2014 04:30:05 +0000 (21:30 -0700)]
split off Reshape for loss layers

10 years agosplit off Reshape for data layers
Jonathan L Long [Wed, 10 Sep 2014 21:57:07 +0000 (14:57 -0700)]
split off Reshape for data layers

10 years agoseparate setConvolutionDesc from createConvolutionDesc
Jonathan L Long [Thu, 11 Sep 2014 06:15:22 +0000 (23:15 -0700)]
separate setConvolutionDesc from createConvolutionDesc

10 years agoseparate setTensor4dDesc from createTensor4dDesc
Jonathan L Long [Thu, 11 Sep 2014 04:51:58 +0000 (21:51 -0700)]
separate setTensor4dDesc from createTensor4dDesc

This will make it possible to add reshaping to cuDNN layers.

10 years agoenable reshaping in the forward pass
Jonathan L Long [Wed, 10 Sep 2014 21:51:58 +0000 (14:51 -0700)]
enable reshaping in the forward pass

Note that calling Reshape when no reshape is necessary should be
effectively a no-op, so this is not a performance regression.

10 years agodon't reallocate blobs when shrinking memory use
Jonathan L Long [Wed, 2 Jul 2014 20:08:26 +0000 (13:08 -0700)]
don't reallocate blobs when shrinking memory use

This allows nets to be reshaped very quickly (essentially for free) as
long as sufficient memory has been allocated. Calling Blob::Reshape in
order to free up memory becomes impossible; however, this is not a
normal use case (and deleting blobs does free memory).

10 years agoadd abstract Layer::Reshape, and document the new method protocol
Jonathan L Long [Wed, 10 Sep 2014 21:43:11 +0000 (14:43 -0700)]
add abstract Layer::Reshape, and document the new method protocol

10 years agouse Blob directly instead of shared_ptr for EltwiseLayer::max_idx_
Jonathan L Long [Thu, 11 Sep 2014 05:06:15 +0000 (22:06 -0700)]
use Blob directly instead of shared_ptr for EltwiseLayer::max_idx_

This is in keeping with #742.

10 years agoMerge pull request #1104 from shelhamer/conv-comments-tests
Evan Shelhamer [Thu, 18 Sep 2014 16:45:31 +0000 (09:45 -0700)]
Merge pull request #1104 from shelhamer/conv-comments-tests

Document and Test Convolution

10 years agoMerge pull request #1100 from cNikolaou/issue1099
Evan Shelhamer [Thu, 18 Sep 2014 16:41:34 +0000 (09:41 -0700)]
Merge pull request #1100 from cNikolaou/issue1099

Polish mnist + cifar10 examples.

10 years ago[docs] lenet grooming
Evan Shelhamer [Thu, 18 Sep 2014 16:41:19 +0000 (09:41 -0700)]
[docs] lenet grooming

10 years ago[docs] comment ConvolutionLayer
Evan Shelhamer [Thu, 18 Sep 2014 06:38:31 +0000 (23:38 -0700)]
[docs] comment ConvolutionLayer

10 years agotest convolution by random weights for robustness
Evan Shelhamer [Thu, 18 Sep 2014 15:40:00 +0000 (08:40 -0700)]
test convolution by random weights for robustness

10 years agotest convolution against explicit reference implementation
Evan Shelhamer [Wed, 17 Sep 2014 22:10:18 +0000 (15:10 -0700)]
test convolution against explicit reference implementation

To thoroughly check convolution, the output is compared against a
reference implementation by explicit looping. Simple and group
convolution by the Caffe and cuDNN engines are checked against the
reference.

10 years agoUpdated mnist/readme.md file with additional information.
Christos Nikolaou [Thu, 18 Sep 2014 09:49:17 +0000 (12:49 +0300)]
Updated mnist/readme.md file with additional information.

10 years agoUpdate readme.md files of cifar10 and mnist examples. Fixed broken links.
Christos Nikolaou [Wed, 17 Sep 2014 18:28:51 +0000 (21:28 +0300)]
Update readme.md files of cifar10 and mnist examples. Fixed broken links.

10 years agoMerge pull request #1093 from CellScope/io-cant-load-error-msg
Evan Shelhamer [Tue, 16 Sep 2014 23:01:13 +0000 (16:01 -0700)]
Merge pull request #1093 from CellScope/io-cant-load-error-msg

[fix] Move file reading error checking closer to actual file read command

10 years ago[Bugfix] Move error checking closer to file read
Daniel Golden [Tue, 9 Sep 2014 20:42:40 +0000 (13:42 -0700)]
[Bugfix] Move error checking closer to file read

Previously, if (height > 0 && width > 0) was true, the
cv::resize() function would be called before cv_img_origin was
confirmed valid; if the image file/filename was not valid, this
caused an opencv assert error like this:

terminate called after throwing an instance of 'cv::Exception'
  what():  /tmp/A3p0_4200_32550/batserve/A3p0/glnxa64/OpenCV/modules/imgproc/src/imgwarp.cpp:1725: error: (-215)
  ssize.area() > 0 in function resize

10 years agoMerge pull request #1088 from shelhamer/fix-solverstate-filename
longjon [Tue, 16 Sep 2014 22:38:05 +0000 (15:38 -0700)]
Merge pull request #1088 from shelhamer/fix-solverstate-filename

Fix snapshot filename for solver states

10 years agoMerge pull request #1091 from ronghanghu/fix_window_data_layer
Jeff Donahue [Tue, 16 Sep 2014 17:33:51 +0000 (10:33 -0700)]
Merge pull request #1091 from ronghanghu/fix_window_data_layer

set up datum size for WindowDataLayer

10 years agoset up datum size for WindowDataLayer
Ronghang Hu [Tue, 16 Sep 2014 16:56:11 +0000 (09:56 -0700)]
set up datum size for WindowDataLayer

10 years ago[fix] snapshot model weights as .caffemodel, solver state as .solverstate
Evan Shelhamer [Tue, 16 Sep 2014 15:19:02 +0000 (08:19 -0700)]
[fix] snapshot model weights as .caffemodel, solver state as .solverstate

10 years ago[example] update paths in net surgery
Evan Shelhamer [Tue, 16 Sep 2014 15:13:17 +0000 (08:13 -0700)]
[example] update paths in net surgery

10 years agoMerge pull request #1083 from longjon/fix-solver-gpu-init
Evan Shelhamer [Mon, 15 Sep 2014 22:59:17 +0000 (15:59 -0700)]
Merge pull request #1083 from longjon/fix-solver-gpu-init

Fix solver GPU initialization order (e.g., training with cuDNN on non-default device)

10 years agofix caffe train GPU initialization
Jonathan L Long [Mon, 15 Sep 2014 21:15:58 +0000 (14:15 -0700)]
fix caffe train GPU initialization

Previously, the solver constructed nets before the caffe train tool read
the --gpu flag, which can cause errors due to LayerSetUp executing on
the wrong device (breaking cuDNN, for example).

10 years agoMerge pull request #1077 from bhack/glog_ppa
Jeff Donahue [Sun, 14 Sep 2014 22:14:46 +0000 (15:14 -0700)]
Merge pull request #1077 from bhack/glog_ppa

Add ppa for gflag and glog

10 years agoMerge pull request #1076 from kloudkl/cuda-6.5
Evan Shelhamer [Sun, 14 Sep 2014 21:18:52 +0000 (14:18 -0700)]
Merge pull request #1076 from kloudkl/cuda-6.5

Update CUDA to version 6.5 in the Travis install script

10 years agoFix a little typo
bhack [Sun, 14 Sep 2014 20:19:51 +0000 (22:19 +0200)]
Fix a little typo

10 years agoFix comments
bhack [Sun, 14 Sep 2014 19:16:38 +0000 (21:16 +0200)]
Fix comments

10 years agofix spelling error in caffe.proto
Jonathan L Long [Sun, 14 Sep 2014 01:30:52 +0000 (18:30 -0700)]
fix spelling error in caffe.proto

10 years agofix out-of-date next ID comment for SolverParameter
Jonathan L Long [Sun, 14 Sep 2014 01:30:32 +0000 (18:30 -0700)]
fix out-of-date next ID comment for SolverParameter

10 years agoUpdate CUDA to version 6.5 in the Travis install script
Kai Li [Fri, 12 Sep 2014 16:21:06 +0000 (00:21 +0800)]
Update CUDA to version 6.5 in the Travis install script

10 years agoAdd ppa for gflag and glog
bhack [Fri, 12 Sep 2014 17:50:15 +0000 (19:50 +0200)]
Add ppa for gflag and glog

10 years agoMerge pull request #1051 from jeffdonahue/travis-red-errors
Jeff Donahue [Thu, 11 Sep 2014 15:45:09 +0000 (17:45 +0200)]
Merge pull request #1051 from jeffdonahue/travis-red-errors

restore "red X" build failures in Travis

10 years agoadd -fPIC flag to CMake build
Jeff Donahue [Thu, 11 Sep 2014 14:08:12 +0000 (16:08 +0200)]
add -fPIC flag to CMake build

10 years agorestore "red X" build failures in Travis
Jeff Donahue [Mon, 8 Sep 2014 09:11:41 +0000 (11:11 +0200)]
restore "red X" build failures in Travis

10 years agoMerge pull request #1067 from bhack/lmdb
Jeff Donahue [Thu, 11 Sep 2014 05:00:33 +0000 (07:00 +0200)]
Merge pull request #1067 from bhack/lmdb

Get lmdb from openldap

10 years agoFix lmbdb travis with openldap
bhack [Wed, 10 Sep 2014 22:36:04 +0000 (00:36 +0200)]
Fix lmbdb travis with openldap

10 years agoMerge pull request #1053 from jeffdonahue/to3i-elem_max_layer
Jeff Donahue [Wed, 10 Sep 2014 13:49:45 +0000 (15:49 +0200)]
Merge pull request #1053 from jeffdonahue/to3i-elem_max_layer

rebase and fixup #688 from @to3i: elementwise max