コード例 #1
0
        public MaxPool2D(LayerData data) : base(data)
        {
            MP mp = JsonConvert.DeserializeObject <MP>(data.classData);

            width  = mp.width;
            height = mp.height;
        }
コード例 #2
0
        public override LayerData SaveJSON()
        {
            LayerData   data = base.SaveJSON();
            FullConData fd   = new FullConData();

            fd.weights     = weights;
            data.classData = JsonConvert.SerializeObject(fd);
            return(data);
        }
コード例 #3
0
        public Conv2D(LayerData data) : base(data)
        {
            Conv2DData cd = JsonConvert.DeserializeObject <Conv2DData>(data.classData);

            weights = cd.weights;
            width   = cd.width;
            height  = cd.height;
            count   = cd.count;
            chanels = cd.chanels;
        }
コード例 #4
0
ファイル: Layer.cs プロジェクト: rewin123/Boxer-master_is_bad
        public virtual LayerData SaveJSON()
        {
            LayerData data = new LayerData();

            data.className       = GetType().Name;
            data.activationClass = func.GetType().Name;
            data.input_size      = input_size;
            data.output_size     = output_size;
            return(data);
        }
コード例 #5
0
        public TSConv2D(LayerData data) : base(data)
        {
            var ts = JsonConvert.DeserializeObject <TSData>(data.classData);

            this.width_in   = ts.width_in;
            this.height_in  = ts.height_in;
            this.ch_out     = ts.ch_out;
            this.width_out  = ts.width_out;
            this.height_out = ts.height_out;
            weights         = ts.weights;
        }
コード例 #6
0
ファイル: Layer.cs プロジェクト: rewin123/Boxer-master_is_bad
        public virtual LayerData SaveJSON()
        {
            LayerData data = new LayerData();

            data.className       = GetType().Name;
            data.activationClass = func.GetType().Name;
            data.activationData  = JsonConvert.SerializeObject(func);
            data.input_size      = input_size;
            data.output_size     = output_size;
            return(data);
        }
コード例 #7
0
        public override LayerData SaveJSON()
        {
            LayerData data = base.SaveJSON();

            var mp = new MP
            {
                width  = width,
                height = height
            };

            data.classData = JsonConvert.SerializeObject(mp);

            return(data);
        }
コード例 #8
0
        public virtual string SaveJSON()
        {
            LayerData[] datas = new LayerData[layers.Count];
            for (int i = 0; i < datas.Length; i++)
            {
                datas[i] = layers[i].SaveJSON();
            }

            LDArray ld = new LDArray
            {
                datas = datas
            };

            return(JsonConvert.SerializeObject(ld));
        }
コード例 #9
0
ファイル: Layer.cs プロジェクト: rewin123/Boxer-master_is_bad
        public static Layer CreateFromJSON(LayerData data)
        {
            var assembly = Assembly.GetExecutingAssembly();
            var type     = assembly.GetTypes()
                           .First(t => t.Name == data.className);

            var act_type = assembly.GetTypes()
                           .First(t => t.Name == data.activationClass);

            Layer l = (Layer)Activator.CreateInstance(type, data); //(Layer)Activator.CreateInstance(type, data);

            l.func = (Activation)Activator.CreateInstance(act_type);

            return(l);
        }
コード例 #10
0
        public override LayerData SaveJSON()
        {
            LayerData data = base.SaveJSON();

            var cd = new Conv2DData
            {
                weights = weights,
                width   = width,
                height  = height,
                count   = count,
                chanels = chanels
            };

            data.classData = JsonConvert.SerializeObject(cd);

            return(data);
        }
コード例 #11
0
        public override LayerData SaveJSON()
        {
            LayerData dd = base.SaveJSON();

            TSData ts = new TSData
            {
                width_in   = width_in,
                height_in  = height_in,
                ch_out     = ch_out,
                width_out  = width_out,
                height_out = height_out,
                weights    = weights
            };

            dd.classData = JsonConvert.SerializeObject(ts);

            return(dd);
        }
コード例 #12
0
        public Dropout(LayerData data) : base(data)
        {
            var ddata = JsonConvert.DeserializeObject <DData>(data.classData);

            width = ddata.width;
        }
コード例 #13
0
ファイル: Layer.cs プロジェクト: rewin123/Boxer-master_is_bad
 public Layer(LayerData data)
 {
     input_size  = data.input_size;
     output_size = data.output_size;
 }
コード例 #14
0
        public FullyConnLayar(LayerData data) : base(data)
        {
            FullConData fd = JsonConvert.DeserializeObject <FullConData>(data.classData);

            weights = fd.weights;
        }
コード例 #15
0
 public FCRecursiveLayer(LayerData data) : base(data)
 {
 }