Created
April 28, 2018 09:39
-
-
Save mratsim/98c59c0a173c06d1bf406b88f4683277 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type | |
| TrainableLayer = object {.inheritable.} | |
| ## Layer with trainable parameters | |
| weight: int | |
| bias: int | |
| Conv2DLayer{.final.} = object of TrainableLayer | |
| LinearLayer{.final.} = object of TrainableLayer | |
| ################################################# | |
| type | |
| Trainable = concept layer | |
| layer.weight is int | |
| layer.bias is int | |
| Conv2D_v2 = object | |
| weight: int | |
| bias: int | |
| Linear_v2 = object | |
| weight: int | |
| bias: int | |
| let a = Conv2DLayer(weight: 1, bias: 10) | |
| let b = Conv2D_v2(weight: 2, bias: 3) | |
| echo a is Trainable | |
| echo b is Trainable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment