public MaxPool2D(LayerData data) : base(data) { MP mp = JsonConvert.DeserializeObject <MP>(data.classData); width = mp.width; height = mp.height; }
public override LayerData SaveJSON() { LayerData data = base.SaveJSON(); FullConData fd = new FullConData(); fd.weights = weights; data.classData = JsonConvert.SerializeObject(fd); return(data); }
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; }
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); }
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; }
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); }
public override LayerData SaveJSON() { LayerData data = base.SaveJSON(); var mp = new MP { width = width, height = height }; data.classData = JsonConvert.SerializeObject(mp); return(data); }
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)); }
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); }
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); }
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); }
public Dropout(LayerData data) : base(data) { var ddata = JsonConvert.DeserializeObject <DData>(data.classData); width = ddata.width; }
public Layer(LayerData data) { input_size = data.input_size; output_size = data.output_size; }
public FullyConnLayar(LayerData data) : base(data) { FullConData fd = JsonConvert.DeserializeObject <FullConData>(data.classData); weights = fd.weights; }
public FCRecursiveLayer(LayerData data) : base(data) { }