File models.py
has 1637 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""deep autoencoder models for unsupervised pose detection.
- VQ-VAE: a variational autoencoder with a vector quantization latent-space (https://arxiv.org/abs/1711.00937).
- VaDE: a variational autoencoder with a Gaussian mixture latent-space.
- Contrastive: an embedding model consisting of a single encoder, trained using a contrastive loss.
Function __init__
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_TCN_encoder
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_TCN_encoder(
Function get_vade
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_vade(
Function __init__
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function call
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def call(self, inputs, training=False): # pragma: no cover
"""Compute the output of the layer."""
z_gauss_mean = self.z_gauss_mean(inputs)
z_gauss_var = self.z_gauss_var(inputs)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_TCN_decoder
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_TCN_decoder(
Function get_vqvae
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_vqvae(
Function get_transformer_encoder
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_transformer_encoder(
Function call
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(self, inputs, training=False): # pragma: no cover
"""Compute the output of the layer."""
z_gauss_mean = self.z_gauss_mean(inputs)
z_gauss_var = self.z_gauss_var(inputs)
Function __init__
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def __init__(
self,
input_shape: tuple,
edge_feature_shape: tuple,
adjacency_matrix: np.ndarray = None,
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_recurrent_encoder
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_recurrent_encoder(
Function pretrain
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def pretrain(
Function get_transformer_decoder
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_transformer_decoder(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function test_step
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def test_step(self, data): # pragma: no cover
"""Performs a test step."""
# Unpack data, repacking labels into a generator
x, a, y = data
if not isinstance(y, tuple):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function train_step
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def train_step(self, data): # pragma: no cover
"""Perform a training step."""
# Unpack data, repacking labels into a generator
x, a, y = data
if not isinstance(y, tuple):
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"