-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactored product to get_product #190
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.
The following are just notes of the meeting
also more precise docstring for get_product
f8d7e6d
to
afc1f4c
Compare
"""Get the symbolic config to construct the product of this layer with the other layer. | ||
|
||
Cases: | ||
- Product with another HadamardLayer: layer config unchanged. \ |
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.
docstring: input layer > 2
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.
List Pre-requisite: expect inputs to match
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.
as below
|
||
Alternative usage: | ||
- If performing product between product layer and sum-product layer, break the. \ | ||
sum-product layer into sum and product layers beforehand. |
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.
automatically do this?
- If performing product between product layer and sum-product layer, break the. \ | ||
sum-product layer into sum and product layers beforehand. | ||
- If pushing this layer into the input of the other layer instead, use. \ | ||
other_layer.get_product(other_layer, this_layer, push_to_input=True). |
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.
not commutative?
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.
only need to pay attention to bold comments. others are minor things that can be postponed.
why no get_product
for SumProdL and CP? add # NOTE
comment to explain. also explicitly NotImplErr in TuckerL
2515fef
to
45f0895
Compare
Added
get_product()
currently support same scope product, have un-implemented templates for different scope product, the cases written with
TODO
would need to be discussed (ideally implement them in the actual layers, and keepreparam=self_symb_cfg.reparam
inget_product()
The cases without
TODO
are not urgent and could be ignored for nowNote that to simplify
get_product()
(avoid too many cases), callingself_layer.get_product()
andother_layer.get_product()
is different: e.g. ifself_layer
is input layer andother_layer
is product layer, should always callother_layer.get_product()
,self_layer.get_product()
in this case would raise an error.Discuss:
**Could you check if
id(cls)
andid(CLASS_NAME)
are different within the class methods? In my case the memory ids are different, so I only usedissubclass(other_symb_cfg.layer_cls, cls)
. Might be a potential bug? **Discuss how the
TODO
would be implemented, which are the different cases for different-scope-product we discussed earlier