//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); }
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; }
private void LateUpdate() { NetworkUpdater.Update(); }