Skip to content

Instantly share code, notes, and snippets.

@uni-3
uni-3 / neumf.py
Created July 28, 2020 15:00
neural mf with tensorflow
from dataclasses import dataclass
import tensorflow as tf
# https://www.tensorflow.org/tutorials/quickstart/advanced
@dataclass
class NeuMF:
n_user: int
n_item: int
params: dict
@uni-3
uni-3 / mf_keras.ipynb
Last active August 2, 2020 04:55
matrix factorization with tensorflow
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uni-3
uni-3 / 3_3_periodic_boundary_conditions.py
Created January 17, 2021 10:46
Periodic boundary conditions in 2D
import numpy as np
# Periodic boundary conditions 2D
a = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
print(a)
# 5: 2, 8, 4, 6
i, j = 1, 1
print(f"{a[i, j]}'s nearest neighbor" )
print(a[i-1, j], a[i+1, j], a[i, j-1], a[i, j+1])
@uni-3
uni-3 / ising_cnn.ipynb
Created January 19, 2021 14:09
ising_cnn.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uni-3
uni-3 / main.go
Created July 24, 2022 13:45
io.Writer.Writeに定義されている関数の方と名前を参照するスクリプト
package main
import (
"fmt"
"go/types"
"log"
"golang.org/x/tools/go/loader"
)