static public void create_convolution(UnitLayer from, UnitLayer to, int width, int height) { for (int d = 0; d < to.Depth; d++) { string id = string.Format("C/{0}/{1}/{2}", from.Id, to.Id, d); WeightLayer layer = new WeightLayer(id, width, height, from.Depth); layer.fill_weights(from.Width * from.Height * from.Depth); WeightLayers.Add(id, layer); } }
static public void create_fully_connection(UnitLayer from, UnitLayer to) { for (int d = 0; d < to.Depth; d++) { for (int y = 0; y < to.Height; y++) { for (int x = 0; x < to.Width; x++) { string id = string.Format("F/{0}/{1}/{2}/{3}/{4}", from.Id, to.Id, x, y, d); WeightLayer layer = new WeightLayer(id, from.Width, from.Height, from.Depth); layer.fill_weights(from.Width * from.Height * from.Depth); WeightLayers.Add(id, layer); } } } }