commit | 3b8dea4c7f69cd52b9417153424d411f03bc5375 | [log] [tgz] |
---|---|---|
author | Andreas Köpf <andreas.koepf@xamla.com> | Wed Dec 30 23:29:27 2015 +0100 |
committer | Andreas Köpf <andreas.koepf@xamla.com> | Wed Dec 30 23:29:27 2015 +0100 |
tree | 3b296535bb10cf557967fba0a0b10dee2c9870b8 | |
parent | 6288c5498ebdebfa3d36632a21ff114c89b80874 [diff] |
Move ClassNLLCriterion.c to lib/THNN/generic
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.