private static CVTerm ParseActivationType(ActivationType activation) { string word = activation.ToString(); if (word == "CollisionInducedDissociation") { return(new CVTerm("MS:1000133", "MS", "collision-induced dissociation", "CID")); } if (word == "MultiPhotonDissociation") { return(new CVTerm("MS:1000435", "MS", "photodissociation", "MPD")); } if (word == "ElectronCaptureDissociation") { return(new CVTerm("MS:1000250", "MS", "electron capture dissociation", "ECD")); } if (word == "ElectronTransferDissociation" || word == "NegativeElectronTransferDissociation") { return(new CVTerm("MS:1000598", "MS", "electron transfer dissociation", "ETD")); } if (word == "HigherEnergyCollisionalDissociation") { return(new CVTerm("MS:1000422", "MS", "beam-type collision-induced dissociation", "HCD")); } if (word == "PQD") { return(new CVTerm("MS:1000599", "MS", "pulsed q dissociation", "PQD")); } return(new CVTerm("MS:1000044", "MS", "dissociation method", word)); }
public void Save(string filePath) { using (KeyManagerDataSet DConfig = new KeyManagerDataSet()) { KeyManagerDataSet.KeyManagerRow ptrDev = DConfig.KeyManager.NewKeyManagerRow(); ptrDev.ID = 0; ptrDev.ActivationSequence = ActivationSequence; ptrDev.SequenceTimeout = SequenceTimeout; ptrDev.ActivationType = ActivationType.ToString(); ptrDev.ComboKeyModifiers = (int)Modifier; ptrDev.ComboKey = (int)ActivationKey; DConfig.KeyManager.AddKeyManagerRow(ptrDev); int tID = 0; foreach (KeyManagerItem ptrItem in Items) { KeyManagerDataSet.KeyManagerItemRow tItem = DConfig.KeyManagerItem.NewKeyManagerItemRow(); tItem.ID = tID++; tItem.ParentKey = ptrDev.ID; tItem.Name = ptrItem.Name; tItem.Application = ptrItem.Application; tItem.Arguments = ptrItem.Argument; tItem.ActionType = ptrItem.ActionType.ToString(); tItem.HotKey = ptrItem.HotKey; DConfig.KeyManagerItem.AddKeyManagerItemRow(tItem); } DConfig.WriteXml(filePath); } }
public XElement GetXElement() { var element = new XElement("toast", new XAttribute("version", "3"), Visual.GetXElement()); if (Audio != null) { element.Add(Audio.GetXElement()); } if (Actions != null) { element.Add(Actions.GetXElement()); } if (Scenario.HasValue) { element.Add(new XAttribute("scenario", Scenario.ToString().FirstLetterToLower())); } if (Launch != null) { element.Add(new XAttribute("launch", Launch)); } if (Duration.HasValue) { element.Add(new XAttribute("duration", Duration.ToString().FirstLetterToLower())); } if (ActivationType.HasValue) { element.Add(new XAttribute("activationType", ActivationType.ToString().FirstLetterToLower())); } return(element); }
public void Activate() { if (!activated || retriggerable) { if (!activated) { activated = true; gameObject.SetActive(true); //possibly redundant. i dont know. i have this set in the enemysystem to activate everything in the overall reset gameObject.name += " (activated)"; } if (retriggerable && resetBeforeRetrigger) { LevelReset(); } if (type.Equals(ActivationType.ALLATONCE)) { ActivateAllAtOnce(); } else if (type.Equals(ActivationType.STAGGERED)) { ActivateStaggered(); } else { throw new UnityException("unknown activationtype \"" + type.ToString() + "\""); } } }
/// <summary> /// Сохраняет свёрточную нейросеть в JSON-строку /// </summary> /// <returns>JSON-строка</returns> public string Save() { return(JsonConvert.SerializeObject(new Dictionary <string, string> { { "ConvolutionLayer1", JsonConvert.SerializeObject(cl1) }, { "ConvolutionLayer2", JsonConvert.SerializeObject(cl2) }, { "PoolingLayer1", JsonConvert.SerializeObject(pl1) }, { "perceptron", perceptron.Save() }, { "ActivationType", ActivationType.ToString() }, { "poolSize", poolSize.ToString() }, })); }
public static IActivationFunction GetActivationFunction(ActivationType activationType) { switch (activationType) { case ActivationType.ReLU: return(new ReLU()); case ActivationType.Identity: return(new Identity()); default: throw new InvalidEnumArgumentException(activationType.ToString()); } }
/// <summary> /// Create an activation function object /// </summary> /// <param name="type"> The type of the activation function </param> /// <returns> An instant of an activation function object </returns> public static AActivationFunction CreateActivationFnCLass( ActivationType type ) { AActivationFunction _activationFunction = null; Assembly assembly = Assembly.GetCallingAssembly(); Type[] types = assembly.GetTypes(); for( int i = 0 ; i < types.Length ; i++ ) { if (types[i].IsSubclassOf(typeof(AActivationFunction)) && types[i].Name == type.ToString() ) { _activationFunction = (AActivationFunction)System.Activator.CreateInstance(types[i]); break; } } if ( _activationFunction == null) throw new ArgumentNullException("Activation Function ( Type not found )"); return _activationFunction; }
public override string ToString() { return(TYPE.ToString()); }
/// <summary> /// Create an activation function object /// </summary> /// <param name="type"> The type of the activation function </param> /// <returns> An instant of an activation function object </returns> public static AActivationFunction CreateActivationFnCLass(ActivationType type) { AActivationFunction _activationFunction = null; Assembly assembly = Assembly.GetCallingAssembly(); Type[] types = assembly.GetTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsSubclassOf(typeof(AActivationFunction)) && types[i].Name == type.ToString()) { _activationFunction = (AActivationFunction)System.Activator.CreateInstance(types[i]); break; } } if (_activationFunction == null) { throw new ArgumentNullException("Activation Function ( Type not found )"); } return(_activationFunction); }
protected override void EncodeParameterCore(ref string res) { res += ActivationType.ToString() + " "; }