Browse Source

Merge pull request #421 from Lokad/issue-420

_compute_fans is buggy in VarianceScaling
tags/v0.12
Haiping Chen GitHub 6 years ago
parent
commit
9ff9a19fa6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs

+ 1
- 1
src/TensorFlowNET.Core/Operations/Initializers/VarianceScaling.cs View File

@@ -84,7 +84,7 @@ namespace Tensorflow.Operations.Initializers
// Assuming convolution kernels (2D, 3D, or more).
// kernel shape: (..., input_depth, depth)
int receptive_field_size = 1;
foreach (var dim in shape.Take(2))
foreach (var dim in shape.Take(shape.Length - 2))
receptive_field_size *= dim;
var fan_in = shape[shape.Length - 2] * receptive_field_size;
var fan_out = shape[shape.Length - 1] * receptive_field_size;


Loading…
Cancel
Save