public SerializedStandardLayer(double[] bias, double[,] weights, ActivatorType activatorType, IGradientAdjustmentParameters gradientAdjustmentParameters) { Bias = bias; Weights = weights; ActivatorType = activatorType; GradientAdjustmentParameters = gradientAdjustmentParameters; }
public ActivationLayerConfiguration( MessageShape inputMessageShape, ActivatorType activatorType) : base(inputMessageShape) { ActivatorType = activatorType; }
public ActivationForwardLayer( ActivatorType type, MessageShape inputMessageShape) : base(inputMessageShape, inputMessageShape) { Activator = ActivatorFactory.Produce(type); }
public virtual void Init(ActivatorComponentData data) { m_Cooldown = data.cooldown; m_Radius = data.radius; m_CooldownTimer = cooldown; activatorType = data.activatorType; SetInteractable(true); }
public ActivationFullLayer( ActivatorType type, MessageShape inputMessageShape) : base(type, inputMessageShape) { _cache = inputMessageShape.Depth == 1 ? _cache = new double[inputMessageShape.Size] : _cache = new double[inputMessageShape.Depth, inputMessageShape.Size, inputMessageShape.Size]; }
public static IActivator Produce(ActivatorType type) { switch (type) { case ActivatorType.LogisticActivator: return(new LogisticActivator()); case ActivatorType.TanhActivator: return(new TanhActivator()); case ActivatorType.ReluActivator: return(new ReluActivator()); default: throw new Exception(); } }
public ActivatorComponentData(XElement e) { cooldown = e.GetFloat("cooldown"); radius = e.GetFloat("radius"); if (e.HasAttribute("activator_type")) { activatorType = (ActivatorType)System.Enum.Parse(typeof(ActivatorType), e.GetString("activator_type")); } else { activatorType = ActivatorType.PirateSpawn; } }
public static Activator Produce(ActivatorType type) { switch (type) { case ActivatorType.Sigmoid: return(new LogisticActivator()); case ActivatorType.Tanh: return(new TanhActivator()); case ActivatorType.Relu: return(new ReluActivator()); default: throw new Exception(Messages.ActivatorTypeIsNotSupported); } }
private void PlaceActivator(ActivatorType type, Vector3Int bounds, Vector3Int offset) { if (type == ActivatorType.SingleOnEdge) { // If this is the first platform, we skip BottomLeft because that's where the player spawns. if (FirstPlatform(offset)) { PlaceSingleActivatorOnEdge((EdgeType)Random.Range(1, System.Enum.GetValues(typeof(EdgeType)).Length), bounds, offset); } else { PlaceSingleActivatorOnEdge((EdgeType)Random.Range(0, System.Enum.GetValues(typeof(EdgeType)).Length), bounds, offset); } } _activatorIter++; }
public void AddFullyConnectedLayer(int numberOfNeurons, ActivatorType activatorType, LearningRateAnnealerType lrat) { if (!_layers.OfType <FullyConnectedLayer>().Any()) { var last = _layers.OfType <FilterLayer>().Last(); var fm = last.GetOutputFilterMeta(); _layers.Add(new FlattenLayer(fm.Channels, fm.Size, last.LayerIndex + 1)); } _layers.Add(new FullyConnectedLayer( ActivatorFactory.Produce(activatorType), numberOfNeurons, _layers.Last().GetNumberOfOutputValues(), _layers.Last().LayerIndex + 1, _weightInitializer, lrat)); }
public void AddDetectorLayer(ActivatorType activatorType) { if (_layers.Any()) { _layers.Add(new DetectorLayer( _layers.Last().LayerIndex + 1, ActivatorFactory.Produce(activatorType), _layers.OfType <FilterLayer>().Last().GetOutputFilterMeta())); } else { _layers.Add(new DetectorLayer( 1, ActivatorFactory.Produce(activatorType), new FilterMeta(_networkConfig.InputDimenision, _networkConfig.InputChannels))); } }
public static IActivator Build(ActivatorType activatorType) { switch (activatorType) { case ActivatorType.Sigmoid: return(new Sigmoid()); case ActivatorType.Identity: return(new Identity()); case ActivatorType.LeakyReLU: return(new LeakyReLU()); case ActivatorType.Tanh: return(new Tanh()); case ActivatorType.ReLU: return(new ReLU()); default: throw new InvalidOperationException("Unknown activator type: " + activatorType.ToString()); } }
public void AddActivationLayer(ActivatorType activatorType) { var shape = _layers.Last().GetOutputMessageShape(); _layers.Add(new ActivationFullLayer(activatorType, shape)); }