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

Get rid of Scopes #3

Open
mlajtos opened this issue Oct 3, 2016 · 3 comments
Open

Get rid of Scopes #3

mlajtos opened this issue Oct 3, 2016 · 3 comments

Comments

@mlajtos
Copy link
Owner

mlajtos commented Oct 3, 2016

Scopes are nothing more than anonymous metanodes, so having a special notation for them is unnecessary.

Scope notation (old syntax):

/scope{ In -> Id -> Out}
In -> scope -> Out

Metanode notation:

scope:{ In -> Id -> Out}
In -> scope -> Out

Inline Metanode notation:

In -> scope:{ In -> Id -> Out} -> Out

Anonymous Inline Metanode notation:

In -> { In -> Id -> Out} -> Out

This notation can replace Block Definitions (old name) with Metanode Definitions. So this:

+DoubleIdentity{ In -> Id -> Id -> Out }
In -> DoubleIdentity -> Out

Becomes this:

DoubleIdentity:{ In -> Id -> Id -> Out}
In -> DoubleIdentity -> Out

Therefore one could create metanodes just by copying existing ones, but with different parameters:

DoubleNegation:{
    MyInvert:Invert(mask = 0x0x1)
    In -> MyInv -> MyInv -> Out
}

But the biggest adavantage is ability to lift concrete instance to a class (think siamese architecture):

concreteModel:Model
SharedModel:concreteModel
In -> [SM,SM] -> Out
@mlajtos mlajtos changed the title Get rid of scopes Get rid of Scopes Nov 10, 2016
@mlajtos
Copy link
Owner Author

mlajtos commented Jun 23, 2017

In standalone parser definitions look like this:

+Node:{ In -> Out }
+(Node2 -param defaultValue):{ In -> Out }

Also there is a full support for anonymous metanodes.

Aliasing is not possible yet, but can be substituted with composition:

// Nope: MyDropout:(Dropout -p 0.618)
+MyDropout:{ In -> (Dropout -p 0.618) -> Out }

(I kept the + sign since it is a good indicator of a new definition.)
I have no idea how lifting should work.

@mlajtos mlajtos closed this as completed Jun 23, 2017
@mlajtos
Copy link
Owner Author

mlajtos commented Nov 2, 2017

Anonymous metanodes are also supported in Moniel – 3c4f38b

(This code is total mess, but it is better to go with it and clean it rather to start a new mess.)

Also, composition without In/Out nodes will be much cleaner:

+MyDropout{ Dropout(prob=0.618) }

(Btw params are first-class subnodes, so colon notation should be also usable there.)

@mlajtos mlajtos reopened this Nov 2, 2017
@mlajtos
Copy link
Owner Author

mlajtos commented Nov 2, 2017

But "scope" concept is still in code, so getting rid of it would be nice...

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

No branches or pull requests

1 participant