Skip to content

Commit bb1d3ac

Browse files
authored
Tensorflow 1.x backend: Unify argument names (#1887)
1 parent 9ba2019 commit bb1d3ac

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

deepxde/nn/tensorflow_compat_v1/deeponet.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ class DeepONet(NN):
160160
is a ``dict``, then the trunk net uses the rate `dropout_rate["trunk"]`,
161161
and the branch net uses `dropout_rate["branch"]`. Both `dropout_rate["trunk"]`
162162
and `dropout_rate["branch"]` should be ``float`` or lists of ``float``.
163-
The list length should match the length of `layer_size_trunk` - 1 for the
164-
trunk net and `layer_size_branch` - 2 for the branch net.
163+
The list length should match the length of `layer_sizes_trunk` - 1 for the
164+
trunk net and `layer_sizes_branch` - 2 for the branch net.
165165
trainable_branch: Boolean.
166166
trainable_trunk: Boolean or a list of booleans.
167167
num_outputs (integer): Number of outputs. In case of multiple outputs, i.e., `num_outputs` > 1,
@@ -210,7 +210,7 @@ def __init__(
210210
super().__init__()
211211
if isinstance(trainable_trunk, (list, tuple)):
212212
if len(trainable_trunk) != len(layer_sizes_trunk) - 1:
213-
raise ValueError("trainable_trunk does not match layer_size_trunk.")
213+
raise ValueError("trainable_trunk does not match layer_sizes_trunk.")
214214

215215
self.layer_size_func = layer_sizes_branch
216216
self.layer_size_loc = layer_sizes_trunk
@@ -490,11 +490,11 @@ class DeepONetCartesianProd(NN):
490490
"""Deep operator network for dataset in the format of Cartesian product.
491491
492492
Args:
493-
layer_size_branch: A list of integers as the width of a fully connected network,
493+
layer_sizes_branch: A list of integers as the width of a fully connected network,
494494
or `(dim, f)` where `dim` is the input dimension and `f` is a network
495495
function. The width of the last layer in the branch and trunk net
496496
should be the same for all strategies except "split_branch" and "split_trunk".
497-
layer_size_trunk (list): A list of integers as the width of a fully connected
497+
layer_sizes_trunk (list): A list of integers as the width of a fully connected
498498
network.
499499
activation: If `activation` is a ``string``, then the same activation is used in
500500
both trunk and branch nets. If `activation` is a ``dict``, then the trunk
@@ -505,8 +505,8 @@ class DeepONetCartesianProd(NN):
505505
is a ``dict``, then the trunk net uses the rate `dropout_rate["trunk"]`,
506506
and the branch net uses `dropout_rate["branch"]`. Both `dropout_rate["trunk"]`
507507
and `dropout_rate["branch"]` should be ``float`` or lists of ``float``.
508-
The list length should match the length of `layer_size_trunk` - 1 for the
509-
trunk net and `layer_size_branch` - 2 for the branch net.
508+
The list length should match the length of `layer_sizes_trunk` - 1 for the
509+
trunk net and `layer_sizes_branch` - 2 for the branch net.
510510
num_outputs (integer): Number of outputs. In case of multiple outputs, i.e., `num_outputs` > 1,
511511
`multi_output_strategy` below should be set.
512512
multi_output_strategy (str or None): ``None``, "independent", "split_both", "split_branch" or
@@ -537,8 +537,8 @@ class DeepONetCartesianProd(NN):
537537

538538
def __init__(
539539
self,
540-
layer_size_branch,
541-
layer_size_trunk,
540+
layer_sizes_branch,
541+
layer_sizes_trunk,
542542
activation,
543543
kernel_initializer,
544544
regularization=None,
@@ -547,8 +547,8 @@ def __init__(
547547
multi_output_strategy=None,
548548
):
549549
super().__init__()
550-
self.layer_size_func = layer_size_branch
551-
self.layer_size_loc = layer_size_trunk
550+
self.layer_size_func = layer_sizes_branch
551+
self.layer_size_loc = layer_sizes_trunk
552552
if isinstance(activation, dict):
553553
self.activation_branch = activations.get(activation["branch"])
554554
self.activation_trunk = activations.get(activation["trunk"])
@@ -562,24 +562,24 @@ def __init__(
562562
else:
563563
self.dropout_rate_branch = self.dropout_rate_trunk = dropout_rate
564564
if isinstance(self.dropout_rate_branch, list):
565-
if not (len(layer_size_branch) - 2) == len(self.dropout_rate_branch):
565+
if not (len(layer_sizes_branch) - 2) == len(self.dropout_rate_branch):
566566
raise ValueError(
567567
"Number of dropout rates of branch net must be "
568-
f"equal to {len(layer_size_branch) - 2}"
568+
f"equal to {len(layer_sizes_branch) - 2}"
569569
)
570570
else:
571571
self.dropout_rate_branch = [self.dropout_rate_branch] * (
572-
len(layer_size_branch) - 2
572+
len(layer_sizes_branch) - 2
573573
)
574574
if isinstance(self.dropout_rate_trunk, list):
575-
if not (len(layer_size_trunk) - 1) == len(self.dropout_rate_trunk):
575+
if not (len(layer_sizes_trunk) - 1) == len(self.dropout_rate_trunk):
576576
raise ValueError(
577577
"Number of dropout rates of trunk net must be "
578-
f"equal to {len(layer_size_trunk) - 1}"
578+
f"equal to {len(layer_sizes_trunk) - 1}"
579579
)
580580
else:
581581
self.dropout_rate_trunk = [self.dropout_rate_trunk] * (
582-
len(layer_size_trunk) - 1
582+
len(layer_sizes_trunk) - 1
583583
)
584584
self._inputs = None
585585

0 commit comments

Comments
 (0)