BaseLayer

class tfsnippet.layers.BaseLayer(name=None, scope=None)

Bases: tfsnippet.utils.reuse.VarScopeObject

Base class for all neural network layers.

Attributes Summary

name Get the name of this object.
variable_scope Get the variable scope of this object.

Methods Summary

__call__(…) <==> x(…)
apply(input) Apply the layer on input, to produce output.
build([input]) Build the layer, creating all required variables.

Attributes Documentation

name

Get the name of this object.

variable_scope

Get the variable scope of this object.

Methods Documentation

__call__(...) <==> x(...)
apply(input)

Apply the layer on input, to produce output.

Parameters:input (Tensor or list[Tensor]) – The input tensor, or a list of input tensors.
Returns:The output tensor, or a list of output tensors.
build(input=None)

Build the layer, creating all required variables.

Parameters:input (Tensor or list[Tensor] or None) – If build() is called within apply(), it will be the input tensor(s). Otherwise if it is called separately, it will be None.