Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def dirichlet_bc_func(xs, t, nn):
##################
opt = Adam(loss_function, learning_rate=1.0e-3, has_aux=True, clip_gradients=False)
opt, opt_st = opt.init(params)
for epoch in range(100000):
for epoch in range(1000):
params, opt_st, loss = opt.step(params, opt_st, problem)
# logger.log_loss(loss, epoch)
if epoch % 100 == 0:
Expand Down
7 changes: 4 additions & 3 deletions examples/forward_problems/mechanics/example_hyper_visco_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##################
# for reproducibility
##################
key = random.key(10)
key = random.PRNGKey(10)

##################
# file management
Expand Down Expand Up @@ -93,9 +93,9 @@ def dirichlet_bc_func(xs, t, nn):
# train network
##################
opt = Adam(loss_function, learning_rate=1.0e-3, has_aux=True, clip_gradients=False)
opt_st = opt.init(params)
opt, opt_st = opt.init(params)
for epoch in range(100000):
params, opt_st, loss = opt.step(params, problem, opt_st)
params, opt_st, loss = opt.step(params, opt_st, problem)
# logger.log_loss(loss, epoch)
if epoch % 10 == 0:
print(epoch, flush=True)
Expand All @@ -106,6 +106,7 @@ def dirichlet_bc_func(xs, t, nn):
if epoch % 1000 == 0:
print("writing exodus output")
pp.init(
params,
problem,
f"output_{str(epoch).zfill(6)}.e",
node_variables=["field_values"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# for reproducibility
##################
key = random.PRNGKey(10)
key = random.split(key, 8) # comment this to not use an ensemble
# key = random.split(key, 8) # comment this to not use an ensemble

##################
# file management
Expand Down Expand Up @@ -72,7 +72,7 @@
pp.init(params, problem, 'output.e',
node_variables=[
'field_values',
# 'internal_force'
'internal_force'
],
element_variables=[
# 'deformation_gradient',
Expand Down
Loading