neuroaikit.tf.layers.snubasiccell.SNUBasicCell¶
- class neuroaikit.tf.layers.snubasiccell.SNUBasicCell(*args, **kwargs)[source]¶
Bases:
keras.engine.base_layer.LayerThis is a basic SNU cell.
- Parameters
units – Number of units to create in the layer
decay – Membrane potential decay multiplier, defaults to 0.8, i.e. 0.8 of the previous membrane potential is retained
activation – Activation function, defaults to step_function. See TF_Misc.Activations.
g – Internal state activation function that optionally constraints the state, defaults to tf.identity (no constraint)
recurrent – bool, defaults to False. If True, SNU includes recurrent connections inside entire layer.
Constructor method
Methods
add_lossAdd loss tensor(s), potentially dependent on layer inputs.
add_metricAdds metric tensor to the layer.
add_updateAdd update op(s), potentially dependent on layer inputs.
add_variableDeprecated, do NOT use! Alias for add_weight.
add_weightAdds a new variable to the layer.
applyDeprecated, do NOT use!
Overriding build method that creates the variables
Overriding call method that defines the cell dynamics’ graph
compute_maskComputes an output mask tensor.
compute_output_shapeComputes the output shape of the layer.
compute_output_signatureCompute the output tensor signature of the layer based on the inputs.
count_paramsCount the total number of scalars composing the weights.
finalize_stateFinalizes the layers state after updating layer weights.
from_configCreates a layer from its config.
get_configReturns the config of the layer.
get_input_atRetrieves the input tensor(s) of a layer at a given node.
get_input_mask_atRetrieves the input mask tensor(s) of a layer at a given node.
get_input_shape_atRetrieves the input shape(s) of a layer at a given node.
get_losses_forDeprecated, do NOT use!
get_output_atRetrieves the output tensor(s) of a layer at a given node.
get_output_mask_atRetrieves the output mask tensor(s) of a layer at a given node.
get_output_shape_atRetrieves the output shape(s) of a layer at a given node.
get_updates_forDeprecated, do NOT use!
get_weightsReturns the current weights of the layer, as NumPy arrays.
set_weightsSets the weights of the layer, from NumPy arrays.
with_name_scopeDecorator to automatically enter the module name scope.
Attributes
activity_regularizerOptional regularizer function for the output of this layer.
compute_dtypeThe dtype of the layer’s computations.
dtypeThe dtype of the layer weights.
dtype_policyThe dtype policy associated with this layer.
dynamicWhether the layer is dynamic (eager-only); set in the constructor.
inbound_nodesDeprecated, do NOT use! Only for compatibility with external Keras.
inputRetrieves the input tensor(s) of a layer.
input_maskRetrieves the input mask tensor(s) of a layer.
input_shapeRetrieves the input shape(s) of a layer.
input_specInputSpec instance(s) describing the input format for this layer.
lossesList of losses added using the add_loss() API.
metricsList of metrics added using the add_metric() API.
nameName of the layer (string), set in the constructor.
name_scopeReturns a tf.name_scope instance for this class.
non_trainable_variablesSequence of non-trainable variables owned by this module and its submodules.
non_trainable_weightsList of all non-trainable weights tracked by this layer.
outbound_nodesDeprecated, do NOT use! Only for compatibility with external Keras.
outputRetrieves the output tensor(s) of a layer.
output_maskRetrieves the output mask tensor(s) of a layer.
output_shapeRetrieves the output shape(s) of a layer.
statefulsubmodulesSequence of all sub-modules.
supports_maskingWhether this layer supports computing a mask using compute_mask.
trainabletrainable_variablesSequence of trainable variables owned by this module and its submodules.
trainable_weightsList of all trainable weights tracked by this layer.
updatesvariable_dtypeAlias of Layer.dtype, the dtype of the weights.
variablesReturns the list of all layer variables/weights.
weightsReturns the list of all layer variables/weights.