#!/usr/bin/env python3

# simple example of a functional network
# size defined by arguments

# leaky_relu(input, negative_slope=0.01) 

import torch
import torch.nn.functional as F

def functionalNetwork(x, w1, w2):
  h = F.linear(x, w1)
# h = F.relu(h)
  h = F.leaky_relu(h)
  y = F.linear(h, w2)
  return F.softmax(y, dim=1)

# usage
x  = torch.randn(64, 1000)   # 64 samples, 1000 features
w1 = torch.randn(500, 1000)  # first layer weights
w2 = torch.randn(10, 500)    # second layer weights

output = functionalNetwork(x, w1, w2)
