コード例 #1
0
 public SpeakerCluster(Segment s, Array2DRowRealMatrix featureMatrix, double bicValue)
 {
     _segmentSet        = new SortedSet <Segment>();
     this.FeatureMatrix = new Array2DRowRealMatrix(featureMatrix.getData());
     this._bicValue     = bicValue;
     AddSegment(s);
 }
コード例 #2
0
 public SpeakerCluster(Segment s, Array2DRowRealMatrix featureMatrix, double bicValue)
 {
     this.segmentSet    = new TreeSet();
     this.featureMatrix = new Array2DRowRealMatrix(featureMatrix.getData());
     this.bicValue      = bicValue;
     this.addSegment(s);
 }
コード例 #3
0
        public void MergeWith(SpeakerCluster target)
        {
            if (target == null)
            {
                throw new NullReferenceException();
            }
            var it = target._segmentSet.GetEnumerator();

            while (it.MoveNext())
            {
                if (!AddSegment(it.Current))
                {
                    Console.WriteLine("Something doesn't work in mergeWith method, Cluster class");
                }
            }
            int rowDim           = FeatureMatrix.getRowDimension() + target.FeatureMatrix.getRowDimension();
            int colDim           = FeatureMatrix.getColumnDimension();
            var combinedFeatures = new Array2DRowRealMatrix(rowDim, colDim);

            combinedFeatures.setSubMatrix(FeatureMatrix.getData(), 0, 0);
            combinedFeatures
            .setSubMatrix(target.FeatureMatrix.getData(), FeatureMatrix.getRowDimension(), 0);
            _bicValue     = SpeakerIdentification.GetBICValue(combinedFeatures);
            FeatureMatrix = new Array2DRowRealMatrix(combinedFeatures.getData());
        }
コード例 #4
0
        public virtual void mergeWith(SpeakerCluster target)
        {
            if (target == null)
            {
                throw new NullPointerException();
            }
            Iterator iterator = target.segmentSet.iterator();

            while (iterator.hasNext())
            {
                if (!this.addSegment((Segment)iterator.next()).booleanValue())
                {
                    [email protected]("Something doesn't work in mergeWith method, Cluster class");
                }
            }
            int rowDimension    = this.featureMatrix.getRowDimension() + target.getFeatureMatrix().getRowDimension();
            int columnDimension = this.featureMatrix.getColumnDimension();
            Array2DRowRealMatrix array2DRowRealMatrix = new Array2DRowRealMatrix(rowDimension, columnDimension);

            array2DRowRealMatrix.setSubMatrix(this.featureMatrix.getData(), 0, 0);
            array2DRowRealMatrix.setSubMatrix(target.getFeatureMatrix().getData(), this.featureMatrix.getRowDimension(), 0);
            this.bicValue      = SpeakerIdentification.getBICValue(array2DRowRealMatrix);
            this.featureMatrix = new Array2DRowRealMatrix(array2DRowRealMatrix.getData());
        }