public LSTMCell(ActivationTypes activationType, ushort recurrentInputs = 0) : base(activationType, recurrentInputs) { this.InputGateSynapses = new SynapseCollection <ISynapse>(recurrentInputs); this.ForgetGateSynapses = new SynapseCollection <ISynapse>(recurrentInputs); this.OutputGateSypanses = new SynapseCollection <ISynapse>(recurrentInputs); }
public static IActivationFunction GetActivation(ActivationTypes type) { switch (type) { case ActivationTypes.Sigmoid: return(SigmoidActivation.Instance); case ActivationTypes.SoftPlus: return(SoftPlusActivation.Instance); case ActivationTypes.SoftStep: return(SoftStepActivation.Instance); case ActivationTypes.HyperbolicTangens: return(TanHActivation.Instance); case ActivationTypes.ArcusTangens: return(ArcTanActivation.Instance); case ActivationTypes.RELU: return(RELUActivation.Instance); default: throw new ArgumentException("Invalid argument", nameof(type)); } }
public Neuron(int inputCount, IActivation activation) { this.activation = activation; this.activationType = activation.ActivationType; Weights = new double[inputCount]; WeightsUpdate = new double[inputCount]; PreviousWeightsUpdate = new double[inputCount]; }
public EnemyBehavior(GameObject p_object, int p_hitPoints, int delay, ActivationTypes p_activationType, FacePlayerBehavior p_fpBehavior) { this.hitPoints = 5; this.awakenDistance = 300; this.attackDistance = 60; this.ignoreHitFloor = true; this.Init(p_object, p_hitPoints, delay, p_activationType, p_fpBehavior); }
public override void OnDisplaying() { labelDescription.Visible = false; panelEmailActivation.Visible = false; panelWebsiteActivation.Visible = false; panelEmailActivation.Dock = DockStyle.None; panelWebsiteActivation.Dock = DockStyle.None; panelExtendTrial.Visible = false; panelExtendTrial.Dock = DockStyle.None; switch (ScreenActivate.ActivationType) { case ScreenActivate.ActivationTypes.Instant: labelDescription.Text = "Success! ArchAngel was activated successfully."; labelDescription.Visible = true; ActivationType = ActivationTypes.Instant; break; case ScreenActivate.ActivationTypes.Email: txtWebsiteLicenseNumber.Text = ScreenActivate.LicenseNumber; txtWebsiteInstallationID.Text = frmLicenseWizard.InstallationId; panelEmailActivation.Visible = true; panelEmailActivation.Dock = DockStyle.Fill; ActivationType = ActivationTypes.Email; NextText = "Close"; txtEmailTo.Text = "*****@*****.**"; txtEmailSubject.Text = "Trial License for ArchAngel"; txtEmailBody.Text = string.Format("Please send me an ArchAngel trial license.{1}{1}Hardware ID{1}================================{1}[{0}]{1}================================", frmLicenseWizard.InstallationId, Environment.NewLine); break; case ScreenActivate.ActivationTypes.Website: txtWebsiteLicenseNumber.Text = ScreenActivate.LicenseNumber; txtWebsiteInstallationID.Text = frmLicenseWizard.InstallationId; panelWebsiteActivation.Visible = true; panelWebsiteActivation.Dock = DockStyle.Fill; ActivationType = ActivationTypes.Website; NextText = "Close"; txtWebsiteLicenseNumber.Visible = ScreenStart.Action != ScreenStart.Actions.Trial; lblWebsiteLicenseNumber.Visible = ScreenStart.Action != ScreenStart.Actions.Trial; buttonCopyLicenseNumber.Visible = ScreenStart.Action != ScreenStart.Actions.Trial; break; case ScreenActivate.ActivationTypes.ExtendTrial: txtWebsiteLicenseNumber.Text = ScreenActivate.LicenseNumber; txtWebsiteInstallationID.Text = frmLicenseWizard.InstallationId; panelExtendTrial.Visible = true; panelExtendTrial.Dock = DockStyle.Fill; ActivationType = ActivationTypes.ExtendTrial; break; case ScreenActivate.ActivationTypes.UnlockCode: // Do nothing - we are about to restart the application break; default: throw new NotImplementedException("ActivationType not handled yet: " + ScreenActivate.ActivationType.ToString()); } }
public InputNeuron(ActivationTypes activationType, ushort recurrentInputs = 0) : base(activationType) { if (recurrentInputs != 0) { this.Inputs = new SynapseCollection <ISynapse>(recurrentInputs); } this.Outputs = new SynapseCollection <ISynapse>(); }
public static IActivation CreateActivation(ActivationTypes type) { switch (type) { case ActivationTypes.Sigmoid: return(new Sigmoid()); default: throw new InvalidOperationException("Unknown type"); } }
//public override bool Next() //{ // if (radioWebsite.Checked) // { // ActivationType = ActivationTypes.Website; // } // else if (radioInstant.Checked) // { // ActivationType = ActivationTypes.Instant; // } // else if (radioEmail.Checked) // { // ActivationType = ActivationTypes.Email; // } // #region Activate Full License // if (ScreenStart.Action == ScreenStart.Actions.Activate && SlyceAuthorizer.IsValidLicenseNumber(LicenseNumber)) // { // string hardwareId; // string errorMessage; // if (!SlyceAuthorizer.GetMachineId(out hardwareId, out errorMessage)) // { // MessageBox.Show(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // return false; // } // string message; // switch (ActivationType) // { // case ActivationTypes.Email: // return true; // case ActivationTypes.Instant: // if (!SlyceAuthorizer.IsValidLicenseNumber(LicenseNumber)) // { // MessageBox.Show("The license number must be 15 numeric digits.", "Invalid License Number", MessageBoxButtons.OK, MessageBoxIcon.Error); // return false; // } // ParentForm.Cursor = Cursors.WaitCursor; // Refresh(); // if (SlyceAuthorizer.ActivateViaInternet(LicenseNumber, hardwareId, true, out message)) // { // MessageBox.Show("Your license was installed successfully.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information); // ParentForm.Cursor = Cursors.Default; // frmLicenseWizard.Result = ScreenStart.Actions.Activate; // frmLicenseWizard.CloseWizard(); // return true; // } // MessageBox.Show("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); // ParentForm.Cursor = Cursors.Default; // return false; // case ActivationTypes.Website: // System.Diagnostics.Process.Start(string.Format(@"http://www.slyce.com/Support/?action=getTrial&trialNumber={0}", hardwareId)); // return false; // default: // throw new NotImplementedException("not coded yet"); // } // } // #endregion // #region Activate Trial License // if (ScreenStart.Action == ScreenStart.Actions.Trial) // { // string hardwareId; // string errorMessage; // if (!SlyceAuthorizer.GetMachineId(out hardwareId, out errorMessage)) // { // MessageBox.Show(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // return false; // } // switch (ActivationType) // { // case ActivationTypes.Email: // return true; // case ActivationTypes.Instant: // ParentForm.Cursor = Cursors.WaitCursor; // Refresh(); // string message; // if (SlyceAuthorizer.ActivateViaInternet("", hardwareId, false, out message)) // { // int daysRemaining; // bool errorOccurred; // bool demo; // SlyceAuthorizer.LockTypes lockType; // SlyceAuthorizer.LicenseStates status; // Licensing.SlyceAuthorizer.Reset(); // bool licensed = Licensing.SlyceAuthorizer.IsLicensed("Visual NHibernate License.SlyceLicense", out message, out daysRemaining, out errorOccurred, out demo, out lockType, out status); // if (licensed) // MessageBox.Show("License installed.", "License Installed", MessageBoxButtons.OK, MessageBoxIcon.Information); // else if (demo && daysRemaining >= 0) // MessageBox.Show(string.Format("{0} days remaining.", daysRemaining), "Trial Installed", MessageBoxButtons.OK, MessageBoxIcon.Warning); // else // MessageBox.Show("Your trial has expired.", "Trial Expired", MessageBoxButtons.OK, MessageBoxIcon.Warning); // ParentForm.Cursor = Cursors.Default; // frmLicenseWizard.Result = ScreenStart.Actions.Activate; // frmLicenseWizard.CloseWizard(); // return true; // } // MessageBox.Show("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); // ParentForm.Cursor = Cursors.Default; // return false; // case ActivationTypes.Website: // return true; // default: // throw new NotImplementedException("Not coded yet"); // } // } // #endregion // MessageBox.Show("Please enter the Serial Number you received in your purchase confirmation email.\n(If you can't find it then contact [email protected])", "Invalid License Number", MessageBoxButtons.OK, MessageBoxIcon.Warning); // //txtSerialNumber.Focus(); // //txtSerialNumber.SelectAll(); // return false; //} //private void radioWebsite_CheckedChanged(object sender, EventArgs e) //{ // ActivationType = ActivationTypes.Website; // //ApplyVisibilities(); //} //private void radioInstant_CheckedChanged(object sender, EventArgs e) //{ // ActivationType = ActivationTypes.Instant; // //ApplyVisibilities(); //} //private void radioEmail_CheckedChanged(object sender, EventArgs e) //{ // ActivationType = ActivationTypes.Email; // //ApplyVisibilities(); //} //private void label1_Click(object sender, EventArgs e) //{ //} //private void buttonUnlock_Click(object sender, EventArgs e) //{ // if (!SlyceAuthorizer.IsValidUnlockCode(txtLicenseFile.Text)) // { // MessageBox.Show("The unlock code must be 16 numeric digits.", "Invalid Unlock Code", MessageBoxButtons.OK, MessageBoxIcon.Error); // return; // } // string message; // if (SlyceAuthorizer.ActivateManually(txtLicenseFile.Text, out message)) // { // MessageBox.Show("ArchAngel has been successfully activated: " + message, "Activation Successful", MessageBoxButtons.OK, MessageBoxIcon.Information); // ParentForm.Cursor = Cursors.Default; // frmLicenseWizard.Result = ScreenStart.Actions.Activate; // frmLicenseWizard.CloseWizard(); // } // else // { // MessageBox.Show("Can't unlock.\n" + message, "Activation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); // } //} private void radioUnlockCode_CheckedChanged(object sender, EventArgs e) { ActivationType = ActivationTypes.UnlockCode; }
public bool HandleEvent(BaseCharacter player, ActivationTypes activation) { MapPoint pos = player.GlobalTileLocation; IEnumerable<IMapEvent> events = null; bool handledevents = false; if(player.CurrentMap == null) player.CurrentMap = this.context.SceneProvider.GetPositionableLocalMap (player); if(activation == ActivationTypes.OnMapEnter) { events = this.GetMapsEvents(player.CurrentMap.Map).Where (e => e.Activation == ActivationTypes.OnMapEnter); } else if(activation == ActivationTypes.Activate || activation == ActivationTypes.Collision) { MapPoint newpt = player.GetLookValue(); pos = new MapPoint(pos.X + newpt.X, pos.Y + newpt.Y); events = this.GetMapsEvents (player.WorldName, player.CurrentMap, pos); } else if(activation == ActivationTypes.Movement) { events = this.GetMapsEvents (player.WorldName, player.CurrentMap, pos); } // If we didn't find any events, return. if(events == null) return false; foreach(IMapEvent mapevent in events) { if(mapevent.Activation == ActivationTypes.Static) continue; if(mapevent.Direction == Directions.Any || mapevent.Direction == player.Direction && mapevent.Activation == activation) { mapevent.Trigger(player, this.context); handledevents = true; } } return handledevents; }
public bool HandleEvent(BaseCharacter player, ActivationTypes activation) { BasePoint pos = new BasePoint(player.MapLocation.X, player.MapLocation.Y); if (activation == ActivationTypes.Activate || activation == ActivationTypes.Collision) { BasePoint newpt = player.GetLookPoint(); pos = new BasePoint(pos.X + newpt.X, pos.Y + newpt.Y); } IMapEvent mapevent = GetEvent(new MapPoint(pos.X, pos.Y)); if (mapevent != null && (mapevent.Direction == Directions.Any || mapevent.Direction == player.Direction) && mapevent.Activation == activation) { mapevent.Trigger(player); return true; } return false; }
public Neuron(ActivationTypes activationType) { this.ActivationType = activationType; }
public GRUCell(ActivationTypes activationType) : base(activationType) { }
public static IActivationFunction GetActivation(this Neuron neuron, ActivationTypes type) { return(GetActivation(type)); }
private void Init(GameObject p_object, int p_hitPoints, int delay, ActivationTypes p_activationType, FacePlayerBehavior p_fpBehavior) { this.actType = p_activationType; this.fpBehavior = p_fpBehavior; this.hitPoints = p_hitPoints; this.maxHitpoints = p_hitPoints; this.actionQueue = new Queue<GameAction>(); this.thisObject = p_object; this.nearEventResponse = new EventResponse(); this.farEventResponse = new EventResponse(); this.hitEventResponse = new EventResponse(); this.hitWallEventResponse = new EventResponse(); this.playerAttackEventResponse = new EventResponse(); this.itemDrops = new List<ItemDropProfile>(); this.TimerOffset = delay; if ((this.fpBehavior == FacePlayerBehavior.FaceWhenCreated) && (this.timerOffset <= 0)) { this.timerOffset = 1; } this.currentState = BehaviorStates.Start; if (this.thisObject.ObjClass == ObjectClass.Boss) { this.hitSound = SoundEffects.BossHit; this.dieSound = SoundEffects.BossDie; } else { this.hitSound = SoundEffects.HitEnemy; this.dieSound = SoundEffects.EnemyDie; } }
internal IEnumerable <IOutputNeuron> BuildOutputNeurons(IEnumerable <INeuron> prevLayer, ushort count, ActivationTypes type) { var tempOutputLayer = new List <IOutputNeuron>(count); for (int i = 0; i < count; i++) { var neuron = new OutputNeuron(type); tempOutputLayer.Add(neuron); foreach (var inNeuron in prevLayer) { ConnectAxon(inNeuron, neuron, count); } } ((List <IOutputNeuron>) this.OutputNeurons).AddRange(tempOutputLayer); return(tempOutputLayer); }
public Neuron(ActivationTypes activationType) { this.Function = NetworkUtils.GetActivation(activationType); }