Last active
November 29, 2019 15:39
-
-
Save tonyroberts/ce967d6db5d2f71d94b85f1f3dfacff5 to your computer and use it in GitHub Desktop.
This file contains 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 pyxll import xl_func | |
import torch.nn as nn | |
class NN(nn.Module): | |
"""Neural networks with Sequential layers""" | |
def __init__(self, layers): | |
super(NN, self).__init__() | |
self.layers = nn.Sequential(*layers) | |
def forward(self, x): | |
return self.layers(x) | |
@xl_func("object[]: object") | |
def nn_Sequential(layers): | |
"""Create a neural network from a list of layers.""" | |
return NN(layers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment