  */
 
 /*
- * x = sigmoid(x + y)
+ * if do_sample == true:  x ~ sigmoid(x + y)
+ * if do_sample == false: x = sigmoid(x + y)
+ * `x ~ p` means x is turn on (set to 1.0) with probability of p
  */
 template <bool do_sample>
 __global__ void add_sigmoid(float* x, const float* y, int size){

}
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);
    

    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 );
