commit | 97c5021b683765b1bf63954c8198a03098e18179 | [log] [tgz] |
---|---|---|
author | Andreas Köpf <andreas.koepf@xamla.com> | Sat Dec 12 22:52:35 2015 +0100 |
committer | soumith <soumith@gmail.com> | Tue Dec 29 16:38:06 2015 -0500 |
tree | b1b8f39225e554a72057cb3d245080ecc85941c8 | |
parent | af34140313b5a8aba7486eff29df65a3dadedbd9 [diff] |
Add functional version of AbsCriterion using metatable call THNN state is now passed implicitely.
All functions should accept arguments in the following order. Dots represent any module-specific parameters or buffers, disregarding whether they are used for writing or reading. They should follow the order
[weight], [bias], [any buffers], [additional arguments], [optional arugments]
updateOutput: state, input, output, ... updateGradInput: state, input, gradOutput, gradInput, ... accGradParameters: state, input, gradOutput, [gradWeight], [gradBias], ...
e.g.
void THNN_(HardShrink_updateGradInput)( THNNState* state, THTensor *input, THTensor *gradOutput, THTensor *gradInput, real lambda)
updateOutput: state, input, target, output, ... updateGradInput: state, input, target, gradInput, ...
e.g.
void THNN_(ClassNLLCriterion_updateOutput)( THNNState* state, THTensor *input, THLongTensor *target, THTensor *output, THTensor *weights, THTensor *total_weight, bool sizeAverage)
void THNN_Linear_updateOutput( THTensor *input, THTensor *output, THTensor *weight, THTensor *bias); //<- 10 ->
All arguments should start on a new line after function name, and they should be indented using 10 spaces.
Use 2 spaces for block indentation.