research/lfads/synth_data/synthetic_data_utils.py
File synthetic_data_utils.py
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function add_alignment_projections
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
def add_alignment_projections(datasets, npcs, ntime=None, nsamples=None):
"""Create a matrix that aligns the datasets a bit, under
the assumption that each dataset is observing the same underlying dynamical
system.
- 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 generate_data
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def generate_data(rnn, T, E, x0s=None, P_sxn=None, input_magnitude=0.0,
input_times=None):
""" Generates data from an randomly initialized RNN.
Args:
rnn: the rnn
- 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 generate_data
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_data(rnn, T, E, x0s=None, P_sxn=None, input_magnitude=0.0,
Function generate_rnn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def generate_rnn(rng, N, g, tau, dt, max_firing_rate):