Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 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);
        }
Exemplo n.º 4
0
 public abstract void Init(KohonenSOM parent);
Exemplo n.º 5
0
 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()];
 }
Exemplo n.º 6
0
 public abstract void Init(KohonenSOM parent);
Exemplo n.º 7
0
 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()];
 }