Skip to content

Instantly share code, notes, and snippets.

@tonyroberts
Last active November 29, 2019 12:52
Show Gist options
  • Save tonyroberts/538b0b5020c78cc5589a2b604f2c7dd9 to your computer and use it in GitHub Desktop.
Save tonyroberts/538b0b5020c78cc5589a2b604f2c7dd9 to your computer and use it in GitHub Desktop.
from pyxll import xl_func
import torch.nn as nn
@xl_func
def nn_Linear(in_features: int, out_features: int, bias: bool=True):
"""Create a linear transformation layer."""
return nn.Linear(in_features, out_features, bias)
@xl_func
def nn_Tanh():
"""Create a Tanh transformation layer."""
return nn.Tanh()
@xl_func
def nn_Sigmoid():
"""Create a Sigmoid transformation layer."""
return nn.Sigmoid()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment