//Make sure that there is only one in existance and don't destory it when moving scenes
    void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(this);
        }
        else
        {
            instance = this;
        }

        DontDestroyOnLoad(this.gameObject);
    }
Example #2
0
        public Network(int[] sizes, IActivationFunction activationFunction, bool dropoutOn)
        {
            _random        = new Random();
            _matrixBuilder = Matrix <double> .Build;
            _sizes         = sizes;
            _numLayers     = sizes.Length;
            InitializeBiases();
            InitializeWeights();
            _activationFunction = activationFunction;
            _previousWeights    = _weights.ConvertAll(w => w.Clone());

            _builder = new TemporaryNetworkBuilder(new DropoutAdapter(),
                                                   _random, new DropoutListBuilderFactory().Create(dropoutOn,
                                                                                                   _random));

            _updater   = new NetworkUpdater();
            _dropoutOn = dropoutOn;
        }
Example #3
0
 private void LateUpdate()
 {
     NetworkUpdater.Update();
 }