Esempio n. 1
0
        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 + ".");
                }
            }
        }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 public override void Validate(MyValidator validator)
 {
     //either there is no input, or the input shoud be a scalar
     if (InputNumber != null)
     {
         validator.AssertWarning(InputNumber.Count == 1, this, "There should be no input or the input should be a scalar. (Using just the first element out of " + InputNumber.Count + ".)");
     }
 }
Esempio n. 4
0
        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)
        {
            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 + ")");
                    }
                }
            }
        }
Esempio n. 6
0
        public override void Validate(MyValidator validator)
        {
            // base.Validate(validator); // base checking
            //System.Console.WriteLine("-I- Seg:: use SLIC: Input image; Output1-xyNpoints; Output-desc; Output3-mask with ids");
            validator.AssertError(InputR_BW != null, this, "At leaast the Red - channel must be connected, then it will be Balck white image!");
            validator.AssertError(nSegs > 0, this, "The numbner of segments (nSegs) has to be >0!");
            validator.AssertError(((int)Math.Sqrt(nSegs)) * ((int)Math.Sqrt(nSegs)) == nSegs, this, "The number of segments has to be a*a=nSegs!!!");
            validator.AssertError(InputDimX == InputDimY, this, "Input image has to be square.");


            //--- check if I can nicely devide image into blocks -> than I can have the exact number of segmetns!!!
            int nClusterSize    = (int)Math.Sqrt((float)iDivUp(InputDimX * InputDimY, nSegs));
            int nClustersPerCol = (int)iDivUp(InputDimX, nClusterSize); // original for arbitrary sizes
            int nClustersPerRow = (int)iDivUp(InputDimY, nClusterSize);

            validator.AssertWarning((nClustersPerCol * nClustersPerCol) == nSegs, this, "Be sure that sqrt(nSegs)/ImageWidth is integer. This can be a reason for later errors!");
        }
Esempio n. 7
0
        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(RunFile == "" || File.Exists(RunFile), this, "Please enter an existing lua script file 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;
                }
                }
            }
        }
Esempio n. 8
0
 public override void Validate(MyValidator validator)
 {
     base.Validate(validator);
     validator.AssertWarning(Input.ColumnHint != 1, this, "Node is attached to non-matrix input");
 }
 public override void Validate(MyValidator validator)
 {
     base.Validate(validator);
     validator.AssertError(XInput.Count != 0 && YInput.Count != 0, this, "Both inputs should have size greater than 1.");
     validator.AssertWarning(XInput.Count == 1 && YInput.Count == 1, this, "Inputs should have size 1. Only the first value will be considered.");
 }
Esempio n. 10
0
 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);
 }