def get_main_obj(y,t,nll_type): if(nll_type=='CE'): return _cross_entropy_loss(y,t) elif(nll_type=='QE'): return _quadratic_loss(y,t) else: raise NotImplementedError()
def get_main_obj(y, t, nll_type): if (nll_type == 'CE'): return _cross_entropy_loss(y, t) elif (nll_type == 'QE'): return _quadratic_loss(y, t) else: raise NotImplementedError()
def reconstruction_loss(x,z,dec_f,obj_type='QE'): x_ = dec_f(z) if obj_type == 'QE': return _quadratic_loss(x_,x) elif obj_type == 'CE': return _binary_cross_entropy_loss(x_,x)