File model_utils.py
has 1354 lines of code (exceeds 250 allowed). Consider refactoring. Open
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""Utility functions for both training autoencoder models in deepof.models and tuning hyperparameters with deepof.hypermodels."""
Function embedding_model_fitting
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def embedding_model_fitting(
preprocessed_object: Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray],
adjacency_matrix: np.ndarray,
embedding_model: str,
encoder_type: str,
- 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 embedding_model_fitting
has 30 arguments (exceeds 4 allowed). Consider refactoring. Open
def embedding_model_fitting(
Function embedding_per_video
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def embedding_per_video(
coordinates: coordinates,
to_preprocess: table_dict,
model: tf.keras.models.Model,
scale: str = "standard",
- 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 tune_search
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def tune_search(
Function select_contrastive_loss
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def select_contrastive_loss(
Function embedding_per_video
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def embedding_per_video(
Function get_callbacks
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_callbacks(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function hard_loss
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def hard_loss(
Function find_learning_rate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def find_learning_rate(
Function dcl_loss
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def dcl_loss(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def call(
Function call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def call(
Function fc_loss
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def fc_loss(
Function tune_search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def tune_search(
preprocessed_object: tuple,
adjacency_matrix: np.ndarray,
encoding_size: int,
embedding_model: str,
- 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 get_callbacks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_callbacks(
embedding_model: str,
encoder_type: str,
kmeans_loss: float = 1.0,
input_type: str = False,
- 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"