示例#1
0
        public void SetInputReference(INDArray values)
        {
            Items.Clear();
            for (int i = 0; i < 10; i++)
            {
                Guess guess = new Guess();
                _guesses.Add(guess);
                Items.Add(guess);
            }
            Values = values;
            //TODO: check if hook already added, remove if...
            IDictionary <string, INDArray> block = new Dictionary <string, INDArray>();

            block.Add("inputs", Values);
            block.Add("targets", Handler.NDArray(1, 1, 10));
            if (Hook != null)
            {
                Trainer.Operator.DetachGlobalHook(Hook);
            }

            Hook = new PassNetworkHook(this, block, TimeStep.Every(1, TimeScale.Iteration));
            Trainer.AddGlobalHook(Hook);
        }