give better names for concat reverse
@@ -54,20 +54,20 @@ public class ConcatenationVertex extends DoubleVertex implements Differentiable,
public Map<Vertex, PartialDerivatives> reverseModeAutoDifferentiation(PartialDerivatives derivativeOfOutputsWithRespectToSelf) {
Map<Vertex, PartialDerivatives> splitPartials = new HashMap<>();
- int splitPosition = 0;
+ int currentSplitIndex = 0;
int[] splitIndices = new int[input.length];
for (int i = 0; i < input.length; i++) {
- splitIndices[i] = splitPosition + input[i].getShape()[dimension];
- splitPosition = splitIndices[i];
+ splitIndices[i] = currentSplitIndex + input[i].getShape()[dimension];
+ currentSplitIndex = splitIndices[i];
splitPartials.put(input[i], new PartialDerivatives(new HashMap<>()));
}
- int concatAlongWrtDimension = input[0].getShape().length + dimension;
+ int wrtDimensionToSliceOn = input[0].getShape().length + dimension;
for (Map.Entry<VertexId, DoubleTensor> entry : derivativeOfOutputsWithRespectToSelf.asMap().entrySet()) {
DoubleTensor partial = entry.getValue();
- List<DoubleTensor> splitPartial = partial.split(concatAlongWrtDimension, splitIndices);
+ List<DoubleTensor> splitPartial = partial.split(wrtDimensionToSliceOn, splitIndices);
for (int i = 0; i < splitPartial.size(); i++) {
splitPartials.get(input[i]).putWithRespectTo(entry.getKey(), splitPartial.get(i));
