Пример #1
0
    /// <summary>
    /// Checks if parameters have been updated and reinitializes necessary data.
    /// </summary>
    protected override void UpdateForChangedParams()
    {
        base.UpdateForChangedParams();

        Vector2Int newRes = _featureMapResolution;

        if (_inputLayer)
        {
            newRes = FeatureMap.GetFeatureMapShapeFromInput(_inputLayer.Get2DOutputShape(), convShape, stride, padding ? GetPadding() : new Vector2Int(0, 0));
            _featureMapTheoreticalResolution = FeatureMap.GetTheoreticalFloatFeatureMapShapeFromInput(_inputLayer.Get2DOutputShape(), convShape, stride, padding ? GetPadding() : new Vector2Int(0, 0));
        }

        if (reducedDepth != _oldReducedDepth ||
            convShape != _oldConvShape ||
            newRes != _featureMapResolution ||
            stride != _oldStride ||
            padding != _oldPadding ||
            IsInitialized() == false ||
            _featureMaps == null)
        {
            _featureMapResolution = newRes;

            InitFeatureMaps();
            _oldConvShape    = convShape;
            _oldReducedDepth = reducedDepth;
            _oldStride       = stride;
            _oldPadding      = padding;
        }
    }
Пример #2
0
    /// <summary>
    /// Checks if parameters have been updated and reinitializes necessary data.
    /// </summary>
    protected override void UpdateForChangedParams()
    {
        base.UpdateForChangedParams();

        Vector2Int newRes   = _featureMapResolution;
        int        newDepth = reducedDepth;

        if (_inputLayer)
        {
            newRes = FeatureMap.GetFeatureMapShapeFromInput(_inputLayer.Get2DOutputShape(), convShape, stride, padding ? GetPadding() : new Vector2Int(0, 0));
            _featureMapTheoreticalResolution = FeatureMap.GetTheoreticalFloatFeatureMapShapeFromInput(_inputLayer.Get2DOutputShape(), convShape, stride, padding ? GetPadding() : new Vector2Int(0, 0));


            newDepth = _inputLayer.GetOutputShape().z;

            filterSpacing  = ((ConvLayer)_inputLayer).filterSpacing;
            filterSpread   = ((ConvLayer)_inputLayer).filterSpread;
            lineCircleGrid = ((ConvLayer)_inputLayer).lineCircleGrid;
        }

        if (newRes != _featureMapResolution ||
            newDepth != reducedDepth ||
            stride != _oldStride ||
            IsInitialized() == false ||
            _featureMaps == null)
        {
            _featureMapResolution = newRes;

            reducedDepth = newDepth;
            InitFeatureMaps();
            _oldStride = stride;
        }

        UpdateFeatureMaps();
    }