Skip to content

Instantly share code, notes, and snippets.

@shink
shink / phicomm-k2p.config
Last active February 6, 2021 04:59
.config file used to compile OpenWrt firmware for PHICOMM K2P.
# device info
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt7621=y
CONFIG_TARGET_ramips_mt7621_DEVICE_phicomm_k2p=y
# mips fpu
CONFIG_KERNEL_MIPS_FPU_EMULATOR=y
# package
CONFIG_PACKAGE_curl=y
@shink
shink / maven-mirror-confluent.md
Created September 17, 2022 13:59
maven-mirror-confluent
<mirror>
  <id>confluent</id>
  <mirrorOf>confluent</mirrorOf>
  <name>Confluent</name>
  <url>https://packages.confluent.io/maven/</url>
</mirror>
if __name__ == '__main__':
from kan import *
import torch
import torchvision
# 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, device='cpu', seed=0)
# create dataset f(x,y) = exp(sin(pix)+y^2)
f = lambda x: torch.exp(torch.sin(torch.pi * x[:, [0]]) + x[:, [1]] ** 2)
if __name__ == '__main__':
import torch
torch.set_default_device('cuda')
t1 = torch.tensor([1, 2, 3, 3, 4, 5, 6, 7, 8], dtype=torch.float)
res1 = torch.histc(t1, 5, 7, 7)
print(res1)
t2 = torch.tensor([7], dtype=torch.float)