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
| function logger() { | |
| return function (target, key, descriptor) { | |
| const initialValue = descriptor.value; | |
| descriptor.value = function() { | |
| console.log(`>"${key}" with`, arguments); | |
| return initialValue.apply(null, arguments); | |
| }; | |
| return descriptor; | |
| } | |
| } |
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
| let pastryList: list(pastry) = [ | |
| { label: "🥐 Croissants", flour: 0.7, butter: 0.5, sugar: 0.2, eggs: 0.0 }, | |
| { label: "🍪 Cookies", flour: 0.5, butter: 0.4, sugar: 0.5, eggs: 0.2 }, | |
| { label: "🥞 Pancakes", flour: 0.7, butter: 0.5, sugar: 0.3, eggs: 0.3 }, | |
| { label: "🍩 Dougnuts", flour: 0.5, butter: 0.2, sugar: 0.8, eggs: 0.1 } | |
| ]; | |
| let theList = List.map((item) => <Text>{item.label}</Text>, pastryList); |
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
| from pathlib import Path | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| class TanhNet(nn.Module): | |
| def __init__(self, in_features, h_units): | |
| super(TanhNet, self).__init__() | |
| self.fc1 = nn.Linear(in_features, h_units) |
OlderNewer