 }
 float RBM::calculate_cost_each(const float* v_0){
     float* v_r = reconstruct(v_0);
-    /* print_gpu("v_0", v_0, n_visible); */
-    /* print_gpu("v_r", v_r, n_visible); */
     thrust::device_ptr<float> dv_r(v_r);
     thrust::device_ptr<const float> dv_0(v_0);
     

float* RBM::reconstruct(const float* v_0){
    static float *h_s = NULL, *v_r = NULL;
    if(h_s == NULL){
        cudaErrCheck(cudaMalloc((void**)&v_r, sizeof(float)*n_visible));
        cudaErrCheck(cudaMalloc((void**)&h_s, sizeof(float)*n_hidden));
    }

    get_v_given_h<true>( h_k, v_k );  /* v_k ~ sigmoid(W*h_k + b) */

    // CD-k
    /* see Reference in README.md */ 
    for(int i = 0; i < this->n_CD - 1; ++i){
        get_h_given_v<true>( h_k, v_k ); /* h_k ~ sigmoid(W*h_k + c) */
        get_v_given_h<true>( h_k, v_k ); /* v_k ~ sigmoid(W*h_k + b) */
    }

    /* Do not sample hidden unit in last step of CD (See Hinton's Guide) */
    get_h_given_v<false>( h_k, v_k ); /* h_k <- sigmoid(W*v_k + c) */

    this->update_w( h_0, v_0, h_k, v_k );
