-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
This pull request is a copy of /keras/legacy/layers.py from keras-team/keras