def METHOD_NAME(self):
    weights = generate_weights(self.mesh, self.layers, self.bias)
    for weight, sweight in zip(weights, self.weights):
        for w, sw in zip(weight["coefficient"], sweight["coefficient"]):
            w.vector()[:] = sw
        if "bias" in weight:
            weight["bias"].vector()[:] = sweight["bias"]
    self.weights = weights