阅读量:0
抽取某个激活函数的样子
from kan import * import matplotlib.pyplot as plt # create a KAN: 2D inputs, 1D output, and 5 hidden neurons. cubic spline (k=3), 5 grid intervals (grid=5). model = KAN(width=[2,5,1], grid=5, k=3, seed=0) x = torch.normal(0,1,size=(100,2)) model(x) model.plot(beta=100)
l = 0 i = 0 j = 3 x, y = model.get_fun(l,i,j)