def __init__(self, compute_accuracy=True, lossfun=softmax_cross_entropy.softmax_cross_entropy, branchweight=1, branchweights=None, ent_T=0.1, ent_Ts=None,
accfun=accuracy.accuracy):
super(Chain,self).__init__()
#branchweights = [1]*7+[1000]
self.lossfun = lossfun
if branchweight is not None and branchweights is None:
self.branchweights = [branchweight]
else:
self.branchweights = branchweights
if ent_T is not None and ent_Ts is None:
self.ent_Ts = [ent_T]
else:
self.ent_Ts = ent_Ts
self.accfun = accfun
self.y = None
self.loss = None
self.accuracy = None
self.compute_accuracy = compute_accuracy
评论列表
文章目录