public ContextMap For(WrittenWord word) { if (_contextMapLookup.ContainsKey(word)) { return _contextMapLookup[word]; } var contextMap = new ContextMap(); _contextMapLookup.Add(word,contextMap); return contextMap; }
public TrainingAction(IPlan plan, ContextMaps maps) : base(plan,maps) { _contextMap = maps.For(plan.Word); _weights = _contextMap.NeuronWeights; if (!plan.Output.HasValue) throw new ArgumentException("plan.Output must be set", "plan"); _wordVector = _vectors[plan.Word]; if (_outputArray == null) { _outputArray = OutputToArray(plan.Output.Value); } }