Skip to content

Instantly share code, notes, and snippets.

View ytbilly3636's full-sized avatar
🤒
Out sick

Yuichiro Tanaka ytbilly3636

🤒
Out sick
  • none
  • Japan
View GitHub Profile
#!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import cv2, os, time
# 複数の画像を読み込む関数
def imgsread(path):
# ディレクトリ中のファイル名のリストを取得
filelists = os.listdir(path)
@ytbilly3636
ytbilly3636 / pavlov.py
Created May 9, 2017 06:18
パブロフの犬モデル?
# -*- coding: utf-8 -*-
import sys
import numpy as np
class Net():
def __init__(self, input_size=2):
if input_size < 1:
print 'Error: input_size (argument of Net.__init__) should be > 0.'
sys.exit(1)
@ytbilly3636
ytbilly3636 / chainer-som.py
Created May 17, 2017 07:27
ChainerでSOM?
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import chainer
import chainer.links as L
from chainer import Chain, Variable
from chainer import datasets
class SOM(Chain):
# -*- coding: utf-8 -*-
# caffe2のDB作成に必要
import numpy as np
from StringIO import StringIO
from caffe2.python import core, utils, workspace
from caffe2.proto import caffe2_pb2
# 今回はchainerのデータセットを拝借する
from chainer import datasets
# -*- coding: utf-8 -*-
# 読み込むモジュール
import numpy as np
from caffe2.python import core, cnn, workspace
from matplotlib import pyplot
# 初期化
core.GlobalInit(['caffe2', '--caffe2_log_level=0'])
@ytbilly3636
ytbilly3636 / saleman.py
Created June 6, 2017 10:32
水を求めるミミズ
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
class TravelPoints():
def __init__(self, num_points):
self.points = np.ones((num_points, 2), dtype=np.float32)
return
# -*- coding:utf-8 -*-
'''
Requirements
* chainer
* matplotlib
* MeCab
* OpenJTalk
* requests_oauthlib
* Twitter API
@ytbilly3636
ytbilly3636 / axi_read_write.v
Last active November 26, 2018 10:00
指定されたアドレスのメモリからデータ(4バイトx256)を読みこみ(AXI読み込み),4倍したデータを同じアドレスに書き込む(AXI書き込み).
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 2018/11/16 14:00:00
// Design Name:
// Module Name: axi_read_write
// Project Name:
// Target Devices:
@ytbilly3636
ytbilly3636 / main.c
Created November 19, 2018 10:48
axi_read_write.vを制御するプログラム
/*
axi_read_write.vを制御するプログラム
*/
#include "xparameters.h"
#include "xil_printf.h"
#include "xgpio.h"
#include "xil_cache.h"
XGpio iwSTT;
@ytbilly3636
ytbilly3636 / equation.py
Created December 12, 2018 07:19
GAのようなもので連立方程式を解いてみる
# -*- coding:utf-8 -*-
import numpy as np
class GA(object):
def __init__(self, num, dim):
self.gen = np.random.randn(num, dim)
def run(self, x):
self.y = self.gen.dot(x.T)