本文整理匯總了Python中sonnet.Conv3D方法的典型用法代碼示例。如果您正苦於以下問題:Python sonnet.Conv3D方法的具體用法?Python sonnet.Conv3D怎麽用?Python sonnet.Conv3D使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sonnet
的用法示例。
在下文中一共展示了sonnet.Conv3D方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _build
# 需要導入模塊: import sonnet [as 別名]
# 或者: from sonnet import Conv3D [as 別名]
def _build(self, inputs, is_training):
"""Connects the module to inputs.
Args:
inputs: Inputs to the Unit3D component.
is_training: whether to use training mode for snt.BatchNorm (boolean).
Returns:
Outputs from the module.
"""
net = snt.Conv3D(output_channels=self._output_channels,
kernel_shape=self._kernel_shape,
stride=self._stride,
padding=snt.SAME,
use_bias=self._use_bias)(inputs)
if self._use_batch_norm:
bn = snt.BatchNorm()
net = bn(net, is_training=is_training, test_local_stats=False)
if self._activation_fn is not None:
net = self._activation_fn(net)
return net
示例2: _build
# 需要導入模塊: import sonnet [as 別名]
# 或者: from sonnet import Conv3D [as 別名]
def _build(self, inputs, is_training):
"""Connects the module to inputs.
Args:
inputs: Inputs to the Unit3D component.
is_training: whether to use training mode for snt.BatchNorm (boolean).
Returns:
Outputs from the module.
"""
net = snt.Conv3D(output_channels=self._output_channels,
kernel_shape=self._kernel_shape,
stride=self._stride,
padding=snt.SAME,
use_bias=self._use_bias)(inputs)
if self._use_batch_norm:
bn = snt.BatchNorm()
#################### Warning batchnorm is hard coded to is_training=False #################
# net = bn(net, is_training=is_training, test_local_stats=False)
net = bn(net, is_training=False, test_local_stats=False)
if self._activation_fn is not None:
net = self._activation_fn(net)
return net
示例3: _build
# 需要導入模塊: import sonnet [as 別名]
# 或者: from sonnet import Conv3D [as 別名]
def _build(self, inputs, is_training):
"""Connects the module to inputs.
Args:
inputs: Inputs to the Unit3Dtf component.
is_training: whether to use training mode for snt.BatchNorm (boolean).
Returns:
Outputs from the module.
"""
net = snt.Conv3D(
output_channels=self._output_channels,
kernel_shape=self._kernel_shape,
stride=self._stride,
padding=snt.SAME,
use_bias=self._use_bias)(inputs)
if self._use_batch_norm:
bn = snt.BatchNorm()
net = bn(net, is_training=is_training, test_local_stats=False)
if self._activation_fn is not None:
net = self._activation_fn(net)
return net