{"action":"created","issue":{"url":"https://api.github.com/repos/BVLC/caffe/issues/3044","labels_url":"https://api.github.com/repos/BVLC/caffe/issues/3044/labels{/name}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/3044/comments","events_url":"https://api.github.com/repos/BVLC/caffe/issues/3044/events","html_url":"https://github.com/BVLC/caffe/pull/3044","id":105484642,"number":3044,"title":"NoiseLayer","user":{"login":"jyegerlehner","id":2138320,"avatar_url":"https://avatars.githubusercontent.com/u/2138320?v=3","gravatar_id":"","url":"https://api.github.com/users/jyegerlehner","html_url":"https://github.com/jyegerlehner","followers_url":"https://api.github.com/users/jyegerlehner/followers","following_url":"https://api.github.com/users/jyegerlehner/following{/other_user}","gists_url":"https://api.github.com/users/jyegerlehner/gists{/gist_id}","starred_url":"https://api.github.com/users/jyegerlehner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyegerlehner/subscriptions","organizations_url":"https://api.github.com/users/jyegerlehner/orgs","repos_url":"https://api.github.com/users/jyegerlehner/repos","events_url":"https://api.github.com/users/jyegerlehner/events{/privacy}","received_events_url":"https://api.github.com/users/jyegerlehner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-08T22:51:52Z","updated_at":"2015-09-17T15:19:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BVLC/caffe/pulls/3044","html_url":"https://github.com/BVLC/caffe/pull/3044","diff_url":"https://github.com/BVLC/caffe/pull/3044.diff","patch_url":"https://github.com/BVLC/caffe/pull/3044.patch"},"body":"This PR adds a new layer type `NoiseLayer`. It can be used in a strategy that requires adding noise to a blob, e.g. de-noising autoencoders, [target prop (with corruption)](http://arxiv.org/abs/1407.7906), [\"dither\" as it is called here](http://arxiv.org/abs/1508.04826).\r\n\r\nExample usage is a layer like this used to add gaussian noise to the blob `data`. Top and bottom blobs can be the same for in-place noising, or they can be different.\r\n\r\n```\r\nlayer {\r\n  name: \"noise\"\r\n  type: \"Noise\"\r\n  bottom: \"data\"\r\n  top: \"data\"\r\n  include {\r\n    phase: TRAIN\r\n  }\r\n  noise_param {\r\n    filler_param {\r\n      type: \"gaussian\"\r\n      mean: 0\r\n      std: 0.5\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nI also considered having the noise layer generate a top blob, and EltWise layer to add it in, but that ends up using more memory because you end up with 3 blobs whereas 2 this way (or 1.5 with in-place noise).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/BVLC/caffe/issues/comments/141119637","html_url":"https://github.com/BVLC/caffe/pull/3044#issuecomment-141119637","issue_url":"https://api.github.com/repos/BVLC/caffe/issues/3044","id":141119637,"user":{"login":"jyegerlehner","id":2138320,"avatar_url":"https://avatars.githubusercontent.com/u/2138320?v=3","gravatar_id":"","url":"https://api.github.com/users/jyegerlehner","html_url":"https://github.com/jyegerlehner","followers_url":"https://api.github.com/users/jyegerlehner/followers","following_url":"https://api.github.com/users/jyegerlehner/following{/other_user}","gists_url":"https://api.github.com/users/jyegerlehner/gists{/gist_id}","starred_url":"https://api.github.com/users/jyegerlehner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyegerlehner/subscriptions","organizations_url":"https://api.github.com/users/jyegerlehner/orgs","repos_url":"https://api.github.com/users/jyegerlehner/repos","events_url":"https://api.github.com/users/jyegerlehner/events{/privacy}","received_events_url":"https://api.github.com/users/jyegerlehner/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T15:19:03Z","updated_at":"2015-09-17T15:19:03Z","body":"> `EltwiseLayer` could be modified to work in-place for the first bottom to the (only) top,\r\n\r\nIn-place calculation isn't always what someone wants with `EltwiseLayer`, nor is suppressing backward prop to a subset of its bottom blobs. So it adds complexity to put some mechanism to do those things, making the code harder to understand. I find this kind of complexity to be a bigger liability than adding a new layer type. Whereas factoring differing behavior into distinct layer types allows each to be simpler and easier to understand, less error-prone to maintain.\r\n\r\nIf modified `EltwiseLayer` and `DummyDataLayer` is your preferred approach I'll close this PR.\r\n\r\n"}}