Example #1
0
        public static Instrumentation MaxPoolingInstrumentation(int[] choices)
        {
            Instrumentation ret = new Instrumentation();

            ret.LayerType = LayerType.POOLING_LAYER;
            ret.DisjunctionConstraints = null;
            ret.Selections             = choices;
            return(ret);
        }
Example #2
0
        public static Instrumentation ReLUInstrumentation(DisjunctionChoice[] choices)
        {
            Instrumentation ret = new Instrumentation();

            ret.LayerType = LayerType.RECTIFIED_LINEAR;
            ret.DisjunctionConstraints = choices;
            ret.Selections             = null;
            return(ret);
        }
Example #3
0
        public static void InitializeNNAnalysis()
        {
            Control.UseNativeMKL();

            String relulog = Utils.RobustnessOptions.ReLULogFile;

            if (relulog != "")
            {
                Instrumentation.InitReLULogging();
            }
        }
        public override Vector <double> EvaluateConcrete(Vector <double> v)
        {
            var res = v.Map(x => Active(x)? x : 0.0);

            if (Utils.RobustnessOptions.ReLULogFile != "")
            {
                var disjunctionChoices = CreateDisjunctionChoices(v);
                Instrumentation.LogDisjunctionChoices(Utils.RobustnessOptions.ReLULogFile, Index, disjunctionChoices);
            }

            return(res);
        }
 public override void Instrument(NNInstrumentation instr, Vector <double> input, Vector <double> output)
 {
     instr[Index] = Instrumentation.NoInstrumentation();
 }
        public override void Instrument(NNInstrumentation instr, Vector <double> input, Vector <double> output)
        {
            var disjunctionChoices = CreateDisjunctionChoices(input);

            instr[Index] = Instrumentation.ReLUInstrumentation(disjunctionChoices);
        }
Example #7
0
 public override void Instrument(NNInstrumentation instrumentation, Vector <double> input, Vector <double> output)
 {
     instrumentation[Index] = Instrumentation.MaxPoolingInstrumentation(new int[OutputDimension]);
     base.ApplyKernels <NumInstDouble, double, Vector <double>, NNInstrumentation>(instrumentation, ApplyKernelConcrete, input);
 }
Example #8
0
 public bool Equals(DisjunctionChoice[] a, DisjunctionChoice[] b)
 {
     return(Instrumentation.EqualDisjunctionChoices(a, b));
 }
Example #9
0
        public static Instrumentation NoInstrumentation()
        {
            Instrumentation ret = new Instrumentation();

            return(ret);
        }