public override void Init(KohonenSOM parent) { this.m_Parent = parent; float[,] globalInput = new float[m_Parent.DataSource.GetPatternCount(), m_Parent.DataSource.GetPatternLength()]; for (int i = 0; i < m_Parent.DataSource.PatternCount; ++i) { for (int j = 0; j < m_Parent.DataSource.GetPatternLength(); ++j) { globalInput[i, j] = m_Parent.DataSource.GetPattern(i)[j]; } } m_GPUInput = new DisposableFloatParallelArray(globalInput); m_GPUWeight = new DisposableFloatParallelArray(m_Parent.NeuronMap); m_GPUCoord = new DisposableFloatParallelArray(m_Parent.NeuronMapCoordArray); }
private void Form1_Load(object sender, EventArgs e) { //New version IDataSource ds = new ColorFromTextDataSource("colors"); IDataSource ds2 = new TimeSerieDataSource("stocks.txt", 16); int[] mapsize = new int [2]; int size = 10; mapsize[0] = size; mapsize[1] = size; IMapShape ms = new SquareShape(mapsize); IKohonenCore kcgpu = new MSRAcceleratorKohonenCore(); IKohonenCore kccpu = new CPUKohonenCore(); somcpu = new KohonenSOM(kccpu, ms, ds2); somgpu = new KohonenSOM(kcgpu, ms, ds2); somcpu.Init(); somgpu.Init(); //pictureBox1.Image = som.ToWeightBitmap(); // }
public override void Init(KohonenSOM parent) { this.m_Parent = parent; float[,] globalInput = new float[m_Parent.DataSource.GetPatternCount(), m_Parent.DataSource.GetPatternLength()]; for (int i = 0; i < m_Parent.DataSource.PatternCount; ++i) for (int j = 0; j < m_Parent.DataSource.GetPatternLength(); ++j) { globalInput[i, j] = m_Parent.DataSource.GetPattern(i)[j]; } m_GPUInput = new DisposableFloatParallelArray(globalInput); m_GPUWeight = new DisposableFloatParallelArray(m_Parent.NeuronMap); m_GPUCoord = new DisposableFloatParallelArray(m_Parent.NeuronMapCoordArray); }
public abstract void Init(KohonenSOM parent);
public override void Init(KohonenSOM parent) { this.m_Parent = parent; m_BMUCoord = new float[this.m_Parent.NeuronMapShape.Dimension]; m_BMUWeight = new float[this.m_Parent.DataSource.GetPatternLength()]; }