Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pescap committed Dec 6, 2023
1 parent ca92dc7 commit b1ea5a2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions deepxde/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from . import config
from . import gradients as grad
from . import utils
from .backend import backend_name, tf, torch, paddle
from .backend import backend_name, tf, torch, paddle, Variable


class Callback:
Expand Down Expand Up @@ -585,20 +585,20 @@ class SoftAdapt(Callback):
"""

def __init__(self, beta=.1, epsilon=1e-8):
def __init__(self, beta=0.1, epsilon=1e-8):
super().__init__()

self.beta = beta
self.epsilon = epsilon

def on_train_begin(self):
loss_weights = tf.constant(self.model.loss_weights)
loss_weights = dde.Variable(loss_weights, trainable=False, dtype=loss_weights.dtype)
loss_weights = Variable(loss_weights, dtype=loss_weights.dtype)
loss_weights *= 0

self.model.loss_weights = loss_weights
print(loss_weights, 'loss_weights')

print(loss_weights, "loss_weights")
# Allow instances to be re-used.
# Evaluate coefficients.
# Update weights.
# Update weights.

0 comments on commit b1ea5a2

Please sign in to comment.