Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

layers.py from keras #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

layers.py from keras #12

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 12, 2020

This pull request is a copy of /keras/legacy/layers.py from keras-team/keras

Copy link

@monocodus monocodus bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is autogenerated code-style review, new suggestions: 6

kwargs['initial_state'] = initial_state
return super(Recurrent, self).__call__(inputs, **kwargs)

def call(self, inputs, mask=None, training=None, initial_state=None):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too long

call( self , inputs , mask = None , training = None , initial_state = None ) now spans 58 lines.
Corresponding modifications started here.
Keep your functions' length within 50 lines to improve readability.

This comment was generated with the following checker: long_method

kwargs['initial_state'] = initial_state
return super(Recurrent, self).__call__(inputs, **kwargs)

def call(self, inputs, mask=None, training=None, initial_state=None):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too complicated

call( self , inputs , mask = None , training = None , initial_state = None ) now has cyclomatic complexity of 13.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.

This comment was generated with the following checker: high_cyclomatic_complexity

self.input_spec = [InputSpec(ndim=5)]
self.state_spec = None

def compute_output_shape(self, input_shape):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function is too complicated

compute_output_shape( self , input_shape ) now has cyclomatic complexity of 12.
Corresponding modifications started here.
Split your routines to keep cyclomatic complexity below 10 to improve their maintainability.

This comment was generated with the following checker: high_cyclomatic_complexity

- [Maxout Networks](http://arxiv.org/abs/1302.4389)
"""

def __init__(self, output_dim,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has too many parameters

__init__( self , output_dim , nb_feature = 4 , init = 'glorot_uniform' , weights = None , W_regularizer = None , b_regularizer = None , activity_regularizer = None , W_constraint = None , b_constraint = None , bias = True , input_dim = None , ** kwargs ) now has 13 parameters.
Functions with parameter list length above 5 are mostly hard to understand and use.
To reduce the number of arguments, you can isolate arguments used together into an object, or split the function

This comment was generated with the following checker: long_parameter_list

- [Highway Networks](http://arxiv.org/abs/1505.00387v2)
"""

def __init__(self,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has too many parameters

__init__( self , init = 'glorot_uniform' , activation = None , weights = None , W_regularizer = None , b_regularizer = None , activity_regularizer = None , W_constraint = None , b_constraint = None , bias = True , input_dim = None , ** kwargs ) now has 12 parameters.
Functions with parameter list length above 5 are mostly hard to understand and use.
To reduce the number of arguments, you can isolate arguments used together into an object, or split the function

This comment was generated with the following checker: long_parameter_list

the initial state of the RNN layer.
"""

def __init__(self, return_sequences=False,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function has too many parameters

__init__( self , return_sequences = False , return_state = False , go_backwards = False , stateful = False , unroll = False , implementation = 0 , ** kwargs ) now has 8 parameters.
Functions with parameter list length above 5 are mostly hard to understand and use.
To reduce the number of arguments, you can isolate arguments used together into an object, or split the function

This comment was generated with the following checker: long_parameter_list

@ghost ghost added Demonstration Python Files in Python labels Jan 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants