示例#1
0
void DestinNetworkAlt::doDestin(float * input_array) { //the image input array

    if (destin->isUniform){
    	//printf("it is uniform\n");
    	
       Uniform_DeleteCentroids(destin);
        Uniform_AddNewCentroids(destin);
        
        //printFloatCentroids(0);
    }
   
    
    
    
    FormulateBelief(destin, input_array);
    //n=GetNodeFromDestin(destin,7,0,0);
    //trial run the src node is the top node(7) and destination node is toplayer-1
    
    int i,j,k;
    
      

    if(this->callback != NULL){
        this->callback->callback(*this );
    }
}
示例#2
0
//iter: current iteration
//maxiter:maximum number of iterations
//rescaleiter: iteration from which rescaling with additional centroids begins(usually maxiter-1)
//rescaletilllayer: layer till which rescaling is done(top down)
//toplayer : topmost layer (no of layers-1)
void DestinNetworkAlt::doDestinwithRescaling(float * input_array,int iter,int maxiter,int rescaleiter,int rescaletilllayer,int toplayer)
{

	 
	 
	  Uniform_DeleteCentroids(destin);
	
    	if(iter==0){destin->rindex=0;}
        int k,i;
        
       
        if(iter>rescaleiter && iter<maxiter-1)
        {
       	std::vector<float> v;
       	float newmu[5000];
       	
       	for(i=0;i<=6;i++)
       	{
       		memset(newmu,0,sizeof(newmu));
	       	for(int j=0;j<destin->nb[toplayer];j++)
	       	{
       		v.clear();
       		v=rescaleCentroid(toplayer,j,i);
       		for(k=0;k<v.size();k++)
		{	
		newmu[k]=v[k];
		}
		Uniform_AddRescale(destin,newmu,i,toplayer);
        	}
        }
        }
        //else
        
        {
        if(iter<maxiter-1){Uniform_AddNewCentroids(destin);}	
        }
        //rescale iter is the iteration from which you want to enable rescaling of centroids
        
    	 
        
    
    	FormulateBelief(destin, input_array);
   	
    	if(iter>=maxiter-1)
    	{
    	printf("enable rescale\n");
    	for(i=toplayer-1;i>=rescaletilllayer;i--){Uniform_addRescaledCentroids(destin,i,iter,rescaleiter,toplayer);}
    	
    	}
    	
    
   
     if(this->callback != NULL){
        this->callback->callback(*this );
    	}
}
示例#3
0
void DestinNetworkAlt::doDestin(float * input_array ) {

    if (destin->isUniform){
        Uniform_DeleteCentroids(destin);
        Uniform_AddNewCentroids(destin);
    }

    FormulateBelief(destin, input_array);

    if(this->callback != NULL){
        this->callback->callback(*this );
    }
}