public override void Validate(MyValidator validator) { // base.Validate(validator); validator.AssertError(Neurons > 0, this, "Number of neurons should be > 0"); validator.AssertWarning(Connection != ConnectionType.NOT_SET, this, "ConnectionType not set for " + this); }
public override void Validate(MyValidator validator) { //base.Validate(validator); validator.AssertError(Neurons > 0, this, "Number of neurons should be > 0"); validator.AssertError(Input != null, this, "Neural network node \"" + this.Name + "\" has no input."); validator.AssertWarning(Connection != ConnectionType.NOT_SET, this, "ConnectionType not set for " + this); }
public override void Validate(MyValidator validator) { base.Validate(validator); if (!ParamsChanged) { validator.AssertError(Layers.Count > 0, this, "The network has no layers."); validator.AssertError(DataInput != null, this, "No input available."); if (DataInput != null) { validator.AssertError(DataInput.Count > 0, this, "Input connected but empty."); validator.AssertWarning(DataInput.ColumnHint > 1, this, "The Data input columnHint is 1."); uint total = InputWidth * InputHeight * InputsCount * ForwardSamplesPerStep; validator.AssertError(DataInput.Count == total, this, "DataInput Count is " + DataInput.Count + ". Expected " + InputLayer.Output.ToString() + " = " + total + "."); } validator.AssertError(TrainingData != null, this, "No TrainingData available."); if (TrainingData != null) { validator.AssertError(TrainingData.Count > 0, this, "TrainingData connected but empty."); validator.AssertWarning(TrainingData.ColumnHint > 1, this, "TrainingData columnHint is 1."); uint total = InputWidth * InputHeight * InputsCount * TrainingSamplesPerStep; validator.AssertError(TrainingData.Count == total, this, "TrainingData Count is " + TrainingData.Count + ". Expected " + InputLayer.Output.ToString() + " = " + total + "."); } validator.AssertError(TrainingLabel != null, this, "No TrainingLabel available."); validator.AssertError(LastLayer != null, this, "Last layer is null."); if (TrainingLabel != null && LastLayer != null) validator.AssertError(TrainingLabel.Count == LastLayer.Output.Count * TrainingSamplesPerStep, this, "Current label dimension is " + TrainingLabel.Count + ". Expected " + TrainingSamplesPerStep + "x" + LastLayer.Output.Count + "."); } }
public override void Validate(MyValidator validator) { base.Validate(validator); if (!ParamsChanged) { validator.AssertError(Layers.Count > 0, this, "The network has no layers."); if (AutoencoderTask.NetworkMode != MyAutoencoderMode.FEATURE_DECODING) { validator.AssertError(DataInput != null, this, "No input available."); if (DataInput != null) { validator.AssertError(DataInput.Count > 0, this, "Input connected but empty."); validator.AssertWarning(DataInput.ColumnHint > 1, this, "The Data input columnHint is 1."); uint total = InputWidth * InputHeight * InputsCount * ForwardSamplesPerStep; validator.AssertError(DataInput.Count == total, this, "DataInput Count is " + DataInput.Count + ". Expected " + InputLayer.Output.ToString() + " = " + total + "."); } } if (AutoencoderTask.NetworkMode == MyAutoencoderMode.TRAINING) { validator.AssertError(LastLayer != null, this, "Last layer is null."); } if (AutoencoderTask.NetworkMode == MyAutoencoderMode.FEATURE_ENCODING || AutoencoderTask.NetworkMode == MyAutoencoderMode.FEATURE_DECODING) { validator.AssertError(FeatureLayer != null, this, "In FEATURE_ENCODING or FEATURE_DECODING mode, a featureLayer must be present in the network architecture"); } if (AutoencoderTask.NetworkMode == MyAutoencoderMode.FEATURE_ENCODING) { if (FeatureOutput != null && FeatureLayer != null) validator.AssertError(FeatureOutput.Count == FeatureLayer.Output.Count * ForwardSamplesPerStep, this, "In FEATURE_DECODING mode, the Feature output must have the same size (currently " + FeatureOutput.Count + ") as the featureLayer output (" + FeatureLayer.Output.Count + " x " + ForwardSamplesPerStep + ")"); } if (AutoencoderTask.NetworkMode == MyAutoencoderMode.FEATURE_DECODING) { validator.AssertError(FeatureInput != null, this, "In FEATURE_DECODING mode, the Feature input must be connected"); if (FeatureInput != null && FeatureLayer != null) validator.AssertError(FeatureInput.Count == FeatureLayer.Output.Count * ForwardSamplesPerStep, this, "In FEATURE_DECODING mode, the Feature input must have the same size (currently " + FeatureInput.Count + ") as the featureLayer output (" + FeatureLayer.Output.Count + " x " + ForwardSamplesPerStep + ")"); } } }
public static void CheckControlSize(MyValidator validator, MyAbstractMemoryBlock controls, MyWorkingNode sender) { validator.AssertError(controls != null, sender, "Controls are not connected"); if (controls != null) { int neededControls = NrOfControls; int providedControls = controls.Count; validator.AssertError(providedControls >= neededControls, sender, String.Format("Wrong number of actions. With current control mode ({0}) you have to provide at least {1} controls. Provide the correct number of controls or change the control mode.", Mode, neededControls)); validator.AssertWarning(providedControls != neededControls, sender, String.Format("With current control mode ({0}) you should provide {1} controls but you provided {2} controls. Make sure that this is what you want and you have correct control mode chosen.", Mode, neededControls, providedControls)); } }
public override void Validate(MyValidator validator) { validator.AssertError(Controls != null, this, "No controls available"); validator.AssertError(File.Exists(SaveFile), this, "Please specify a correct SaveFile path in world properties."); validator.AssertError(File.Exists(TilesetTable), this, "Please specify a correct TilesetTable path in world properties."); validator.AssertError(FoFSize > 0, this, "FoF size has to be positive."); validator.AssertError(FoFResWidth > 0, this, "FoF resolution width has to be positive."); validator.AssertError(FoFResHeight > 0, this, "FoF resolution height has to be positive."); validator.AssertError(FoVSize > 0, this, "FoV size has to be positive."); validator.AssertError(FoVResWidth > 0, this, "FoV resolution width has to be positive."); validator.AssertError(FoVResHeight > 0, this, "FoV resolution height has to be positive."); validator.AssertError(Width > 0, this, "Free view width has to be positive."); validator.AssertError(Height > 0, this, "Free view height has to be positive."); validator.AssertError(ResolutionWidth > 0, this, "Free view resolution width has to be positive."); validator.AssertError(ResolutionHeight > 0, this, "Free view resolution height has to be positive."); validator.AssertError(ToolSize > 0, this, "Tool size has to be positive."); validator.AssertError(ToolResWidth > 0, this, "Tool resolution width has to be positive."); validator.AssertError(ToolResHeight > 0, this, "Tool resolution height has to be positive."); ControlMapper.CheckControlSize(validator, Controls, this); TryToyWorld(); foreach (TWLogMessage message in TWLog.GetAllLogMessages()) switch (message.Severity) { case TWSeverity.Error: { validator.AssertError(false, this, message.ToString()); break; } case TWSeverity.Warn: { validator.AssertWarning(false, this, message.ToString()); break; } } }