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

Constant Linear Layer #18

Merged
merged 25 commits into from
Oct 20, 2023
Merged

Constant Linear Layer #18

merged 25 commits into from
Oct 20, 2023

Conversation

zhanglw0521
Copy link
Collaborator

The symmetrisation layer (the BB layer) should be a Linear Layer with constant (frozen) parameters. (cf. #12)

@zhanglw0521 zhanglw0521 changed the base branch from main to Rnl_Basis October 1, 2023 21:40
@zhanglw0521
Copy link
Collaborator Author

This one is also usable now though it might not be written in the most elegant manner.

@cortner @CheukHinHoJerry Any feedback from you would be much appreciated.

@CheukHinHoJerry
Copy link
Collaborator

CheukHinHoJerry commented Oct 5, 2023

A note :
After implementation of this Constant Linear Layer we don't need to override the project in SparseArray which causes a type boardcast problem with TrackedReal.

Ref: #17 (comment)

Base automatically changed from Rnl_Basis to main October 5, 2023 19:20
src/ConstLinearLayer.jl Outdated Show resolved Hide resolved
src/ConstLinearLayer.jl Outdated Show resolved Hide resolved
src/ConstLinearLayer.jl Outdated Show resolved Hide resolved
src/ConstLinearLayer.jl Show resolved Hide resolved
@zhanglw0521
Copy link
Collaborator Author

Ready to merge if all of us are happy.

in_dim::Integer
out_dim::Integer
struct ConstLinearLayer <: AbstractExplicitLayer
op
Copy link
Member

Choose a reason for hiding this comment

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

this gives you a type instability. you still need to specify the type of the operator. Something like this:

struct ConstLinL{TOP} 
    op::TOP
end

src/ConstLinearLayer.jl Outdated Show resolved Hide resolved
@zhanglw0521
Copy link
Collaborator Author

Quick question: shall we merge this PR so that the consequential changes can be based on it? We can create an issue if there's still something to be improved in the ConstLinearLayer.

@cortner cortner merged commit a968d5f into main Oct 20, 2023
2 checks passed
@cortner cortner deleted the Const_LinearLayer branch October 20, 2023 17:17
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.

3 participants