Beispiel #1
0
def evaluate_fn(params, batch):
    w = batch["weights"]
    loss_c, loss_d, loss_s = loss_fn_(params, batch)
    l1 = l1_regularization(params[0], 1.0) + l1_regularization(params[1], 1.0)
    l2 = l2_regularization(params[0], 1.0) + l2_regularization(params[1], 1.0)
    return w["c"]*loss_c + w["d"]*loss_d + w["s"]*loss_s + w["l1"]*l1 + w["l2"]*l2, \
      loss_c, loss_d, loss_s, l1, l2
Beispiel #2
0
def evaluate_fn(params, batch):
    w = batch["weights"]
    loss_c1, loss_c2, loss_d1, loss_d2 = loss_fn_(params, batch)
    l1 = l1_regularization(params[0], 1.0) + l1_regularization(params[1], 1.0)
    l2 = l2_regularization(params[0], 1.0) + l2_regularization(params[1], 1.0)
    return w["c1"]*loss_c1 + w["c2"]*loss_c2 + w["d1"]*loss_d1 + w["d2"]*loss_d2 + w["l1"]*l1 + w["l2"]*l2, \
      loss_c1, loss_c2, loss_d1, loss_d2, l1, l2
Beispiel #3
0
def loss_fn(params, batch):
    w = batch["weights"]
    loss_c1, loss_c2, loss_d1, loss_d2 = loss_fn_(params, batch)
    return w["c1"]*loss_c1 + w["c2"]*loss_c2 + w["d1"]*loss_d1 + w["d2"]*loss_d2 + \
      l1_regularization(params, w["l1"]) + l2_regularization(params, w["l2"])
Beispiel #4
0
def loss_fn(params, batch):
    w = batch["weights"]
    loss_c, loss_d, loss_s = loss_fn_(params, batch)
    return w["c"]*loss_c + w["d"]*loss_d + w["s"]*loss_s + \
      l1_regularization(params[0], w["l1"]) + l1_regularization(params[1], w["l1"]) + \
      l2_regularization(params[0], w["l2"]) + l2_regularization(params[1], w["l2"])