Skip to content

Instantly share code, notes, and snippets.

@uni-3
uni-3 / main.go
Created Jul 24, 2022
io.Writer.Writeに定義されている関数の方と名前を参照するスクリプト
View main.go
package main
import (
"fmt"
"go/types"
"log"
"golang.org/x/tools/go/loader"
)
View 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 / 3_3_periodic_boundary_conditions.py
Created Jan 17, 2021
Periodic boundary conditions in 2D
View 3_3_periodic_boundary_conditions.py
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 / mf_keras.ipynb
Last active Aug 2, 2020
matrix factorization with tensorflow
View mf_keras.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 / neumf.py
Created Jul 28, 2020
neural mf with tensorflow
View neumf.py
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 / Dockerfile.gcloud
Created Jul 27, 2020
docker file for gcloud and python3
View Dockerfile.gcloud
FROM google/cloud-sdk:latest
ENV PYTHONUNBUFFERED=1
ENV PYTHONHASHSEED=14
WORKDIR /app/src
# python3
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev python3-venv python3-wheel \
View ginza_mrph.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 / download_s3.py
Created Jul 6, 2020
download from s3
View download_s3.py
# codinf: utf-8
import boto3
from boto3.session import Session
BUCKET = 'bucket'
PATHS = ['data/test.csv']
session = Session(
aws_access_key_id='',
aws_secret_access_key='',
@uni-3
uni-3 / pytrend.ipynb
Last active May 31, 2020
pytrend.ipynb
View pytrend.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 / bayesian_ab.ipynb
Created May 17, 2020
bayesian_ab.ipynb
View bayesian_ab.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.