Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbuster committed Nov 15, 2024
1 parent 0019ffe commit f6b8f6f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions phygnn/layers/custom_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def __init__(self, paddings, mode='REFLECT', option='tf'):
Option for TensorFlow padding ("tf") or numpy ("np"). Default is tf
for tensorflow training. We have observed silent failures of
tf.pad() with larger array sizes, so "np" might be preferable at
inference time on large chunks.
inference time on large chunks, but it is much slower when it has
to convert tensors to numpy arrays.
"""
super().__init__()
self.paddings = tf.constant(paddings)
Expand Down Expand Up @@ -183,6 +184,7 @@ def __init__(self, pool_size, strides=None, padding='valid', sigma=1,
self.trainable = trainable
self.sigma = sigma

# pylint: disable=unused-argument
def build(self, input_shape):
"""Custom implementation of the tf layer build method.
Expand Down Expand Up @@ -490,11 +492,13 @@ def __init__(self, spatial_mult=1, temporal_mult=1,
where the feature axis is unpacked into the temporal axis.
t_roll : int
Option to roll the temporal axis after expanding. When using
temporal_method="depth_to_time", the default (t_roll=0) will
add temporal steps after the input steps such that if input
temporal shape is 3 and the temporal_mult is 24x, the output will
have the original timesteps at idt=0,24,48 but if t_roll=12, the
output will have the original timesteps at idt=12,36,60
temporal_method="depth_to_time", the default (t_roll=0) will add
temporal steps after the input steps such that if input temporal
shape is 3 and the temporal_mult is 24x, the output will have the
index-0 timesteps at idt=0,24,48 but if t_roll=12, the output will
have the original timesteps at idt=12,36,60. This is no longer
recommended, as a positive roll will move the features of timestep
-1 from the end of the series to the beginning.
"""

super().__init__()
Expand Down

0 comments on commit f6b8f6f

Please sign in to comment.