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

use twice Lop to get Rop by default #6037

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

use twice Lop to get Rop by default #6037

wants to merge 1 commit into from

Conversation

khaotik
Copy link
Contributor

@khaotik khaotik commented Jun 13, 2017

Quick PR for #6035

Copy link
Member

@nouiz nouiz left a comment

Choose a reason for hiding this comment

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

I let @lamblin review this in detail. Small comments.

else:
raise NotImplementedError(
"%s of class %s do not have grad or L_op implementation."
"If this is theano Op, mail to theano-dev mailing list for assistance."
Copy link
Member

Choose a reason for hiding this comment

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

theano -> Theano

outputs = self.make_node(inputs).outputs
lop_inputs = [o.type() for o in outputs]
lop_outputs = self.L_op(inputs, outputs, lop_inputs)
return theano.Lop(lop_outputs, lop_inputs, eval_points)
Copy link
Member

Choose a reason for hiding this comment

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

This would need some tests to be sure we don't break it.

It could be a simple test that create a new op with Lop implemented, but not Rop and make sure we can take the Rop. This new Op could inherit from an existing op and delete the Rop method.

@botev
Copy link
Contributor

botev commented Jun 13, 2017

I would actually suggest to possibly add a test, where you go loop to all implemented ops and if they implement Rop you verify that this gives the same result and the standard Rop.
Additionally, it might be interesting to benchmark and see if there are any Ops which have faster-implemented Rops or not.

@lamblin
Copy link
Member

lamblin commented Jun 13, 2017

Agreed with @botev.
The place for such a test would be theano/tests/test_rop.py, and the existing Ops with R_op defined should all be mentioned there already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants