예제 #1
0
        public ComputeGraphTensor(IWeightFactory weightFactory, int deviceId, bool needBack = true)
        {
            weightTensorFactory = weightFactory as WeightTensorFactory;

            needs_backprop = needBack;
            this.deviceId  = deviceId;
        }
예제 #2
0
        public ComputeGraphTensor(IWeightFactory weightFactory, int deviceId, bool needBack = true, bool visNetwork = false, ConcurrentList <Action> backprop = null)
        {
            m_backprop            = backprop != null ? backprop : new ConcurrentList <Action>();
            m_weightTensorFactory = weightFactory as WeightTensorFactory;
            m_needsBackprop       = needBack;
            m_deviceId            = deviceId;
            m_visNeuralNetwork    = visNetwork;

            if (m_visNeuralNetwork)
            {
                // Initialize parameters for neural network visualization
                m_opsViz   = new Microsoft.Msagl.Drawing.Graph();
                m_setEdges = new HashSet <string>();
            }
        }