qkeras.qrecurrent

Quantized recurrent layers for Keras 3 / qkerasV3.

Classes

QBidirectional(*args, **kwargs)

Quantized bidirectional wrapper.

QGRU(*args, **kwargs)

Quantized GRU layer.

QGRUCell(*args, **kwargs)

Quantized GRU cell.

QLSTM(*args, **kwargs)

Quantized LSTM layer.

QLSTMCell(*args, **kwargs)

Quantized LSTM cell.

QSimpleRNN(*args, **kwargs)

Quantized SimpleRNN layer.

QSimpleRNNCell(*args, **kwargs)

Quantized SimpleRNN cell.

class qkeras.qrecurrent.QBidirectional(*args, **kwargs)[source]

Bases: Bidirectional

Quantized bidirectional wrapper.

property activation
get_quantization_config()[source]
get_quantizers()[source]
class qkeras.qrecurrent.QGRU(*args, **kwargs)[source]

Bases: RNN

Quantized GRU layer.

property activation
property bias_constraint
property bias_initializer
property bias_quantizer
property bias_quantizer_internal
property bias_regularizer
call(sequences, initial_state=None, mask=None, training=False)[source]
compute_output_shape(inputs_shape)[source]
property dropout
classmethod from_config(config)[source]

Creates an operation from its config.

This method is the reverse of get_config, capable of instantiating the same operation from the config dictionary.

Note: If you override this method, you might receive a serialized dtype config, which is a dict. You can deserialize it as follows:

```python if “dtype” in config and isinstance(config[“dtype”], dict):

policy = dtype_policies.deserialize(config[“dtype”])

```

Parameters:

config – A Python dictionary, typically the output of get_config.

Returns:

An operation instance.

get_config()[source]

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.

get_prunable_weights()[source]
get_quantization_config()[source]
get_quantizers()[source]
property implementation
property kernel_constraint
property kernel_initializer
property kernel_quantizer
property kernel_quantizer_internal
property kernel_regularizer
property recurrent_activation
property recurrent_constraint
property recurrent_dropout
property recurrent_initializer
property recurrent_quantizer
property recurrent_quantizer_internal
property recurrent_regularizer
property reset_after
property state_quantizer
property state_quantizer_internal
property units
property use_bias
class qkeras.qrecurrent.QGRUCell(*args, **kwargs)[source]

Bases: GRUCell

Quantized GRU cell.

call(inputs, states, training=False)[source]
get_config()[source]

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.

class qkeras.qrecurrent.QLSTM(*args, **kwargs)[source]

Bases: RNN

Quantized LSTM layer.

property activation
property bias_constraint
property bias_initializer
property bias_quantizer
property bias_quantizer_internal
property bias_regularizer
call(sequences, initial_state=None, mask=None, training=False)[source]
compute_output_shape(inputs_shape)[source]
property dropout
classmethod from_config(config)[source]

Creates an operation from its config.

This method is the reverse of get_config, capable of instantiating the same operation from the config dictionary.

Note: If you override this method, you might receive a serialized dtype config, which is a dict. You can deserialize it as follows:

```python if “dtype” in config and isinstance(config[“dtype”], dict):

policy = dtype_policies.deserialize(config[“dtype”])

```

Parameters:

config – A Python dictionary, typically the output of get_config.

Returns:

An operation instance.

get_config()[source]

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.

get_prunable_weights()[source]
get_quantization_config()[source]
get_quantizers()[source]
property implementation
property kernel_constraint
property kernel_initializer
property kernel_quantizer
property kernel_quantizer_internal
property kernel_regularizer
property recurrent_activation
property recurrent_constraint
property recurrent_dropout
property recurrent_initializer
property recurrent_quantizer
property recurrent_quantizer_internal
property recurrent_regularizer
property state_quantizer
property state_quantizer_internal
property unit_forget_bias
property units
property use_bias
class qkeras.qrecurrent.QLSTMCell(*args, **kwargs)[source]

Bases: LSTMCell

Quantized LSTM cell.

call(inputs, states, training=False)[source]
get_config()[source]

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.

class qkeras.qrecurrent.QSimpleRNN(*args, **kwargs)[source]

Bases: RNN

Quantized SimpleRNN layer.

property activation
property bias_constraint
property bias_initializer
property bias_quantizer
property bias_quantizer_internal
property bias_regularizer
call(sequences, initial_state=None, mask=None, training=False)[source]
compute_output_shape(inputs_shape)[source]
property dropout
classmethod from_config(config)[source]

Creates an operation from its config.

This method is the reverse of get_config, capable of instantiating the same operation from the config dictionary.

Note: If you override this method, you might receive a serialized dtype config, which is a dict. You can deserialize it as follows:

```python if “dtype” in config and isinstance(config[“dtype”], dict):

policy = dtype_policies.deserialize(config[“dtype”])

```

Parameters:

config – A Python dictionary, typically the output of get_config.

Returns:

An operation instance.

get_config()[source]

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.

get_prunable_weights()[source]
get_quantization_config()[source]
get_quantizers()[source]
property kernel_constraint
property kernel_initializer
property kernel_quantizer
property kernel_quantizer_internal
property kernel_regularizer
property recurrent_constraint
property recurrent_dropout
property recurrent_initializer
property recurrent_quantizer
property recurrent_quantizer_internal
property recurrent_regularizer
property state_quantizer
property state_quantizer_internal
property units
property use_bias
class qkeras.qrecurrent.QSimpleRNNCell(*args, **kwargs)[source]

Bases: SimpleRNNCell

Quantized SimpleRNN cell.

call(inputs, states, training=False)[source]
get_config()[source]

Returns the config of the object.

An object config is a Python dictionary (serializable) containing the information needed to re-instantiate it.