#n_armed_bandit.py # # n-armed bandit task chapter 2 Figure 2.1, 2.4 # # 1. implemented with softmax function or epsilon-greedy function # 2. implemented with online method for values # 3. implemented with optimistic comparison # import nu…
Analytic solution #heat conduction with a delta function import numpy as np import matplotlib.pyplot as plt import time M = 100; #the number of division x = np.linspace(0, 1, M+1); N = 600; #finite series #T = [0.001, 0.004, 0.016, 0.064] …
We think a case of , .Then, when we think about velocity of this flow along x and y axis. Then we can get Figure1.However, when we think about inertial frame of reference. In this particular case, velocity is equivalent to this formula. [v…
gcc -c main.cpp gcc -o main.cgi main.o -lstdc++ ./main.cgi
import math import numpy as np import matplotlib.pyplot as plt def trapsyn(dt, Tfin, gsyn): VCl = -68; #mV Cm = 1; #micro F/cm^2 gCl = 0.3; #mS/cm^2 z = 2./dt; Nt = int(math.ceil(1 + Tfin / dt)); #number of time steps V = np.zeros((Nt, 1))…
[:large]Neurdon #-*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt #quadratic integrate and fire model class IzhNeuron: def __init__(self, label, a, b, c, d, v0, u0=None): self.label = label self.a = a; self.b = b sel…
#-*- coding:utf-8 -*- import numpy as np import matplotlib.pylab as plt #node def phase_func(x, t, a=-1., b=0., c=0., d=-2.): return np.array([a*x[0]+b*x[1], c*x[0] + d*x[1]]) #focus def phase_focus(x, t, a=1., b=2., c=-2., d=1.): return n…
Kac(Kac, 1974) proved his stochastic model can express the telegrapher’s equa- tion(1). In this report, I would like to predict a function F(x, t) with using the Maclaurin ex- pansion. The expansion of F(x, t) is showed like (2). When we d…
Chapter 1 Origin of appetite Feature of weight: homeostatically weight is controlled a specific part of brain: the hypothalamus which is related to basic desires such as appetite, sleep, emotion. fear and excitement is sent from the limbic…
#-*- coding:utf - 8 #1-6 気軽にウォーミングアップ p21-22 #input #n = 5 #a = [2, 3, 4, 5, 10] n = 4 a = [4,5,10,20] def solve(): #answer ans = 0 #we do not choose choices with duplication for i in xrange(n): for j in xrange(i+1, n): for k i…
Abstract: The mesostriatal dopamine system is prominently implicated in model-free reinforcement learning, with fMRI BOLD signals in ventral striatum notably covarying with model-free prediction errors. However, latent learning and devalua…
Abstract: Decision making in a social group has two distinguishing features. First, humans and other animals routinely alter their behavior in response to changes in their physical and social environment. As a result, the outcomes of decis…
#-*- coding:utf-8 -*- import numpy as np from datetime import datetime def Euler76(A, n): A[0][0] =1 for i in xrange(n): for j in xrange(i + 1): if j == 1: A[i,j] = 1 elif (i == j): A[i,j] = 1 else: A[i, j] = A[i-j, j] + A[i-1][j-1] return…
#-*- coding:utf-8 -*- from datetime import datetime import random import numpy as np #素数判定 def is_prime3(q,k=50): q = abs(q) if q == 2: return True if q < 2 or q&1 == 0: return False d = (q-1)>>1 while d&1 == 0: d >>= 1 for i in xrange…
editing now.....I'm gonna introduce some methods for optimization problems..... Newton method Lenvenberg_marquard method Conjugate Gradient method #-*- coding:utf-8 -*- import numpy as np def Jacobian(x): return np.array([.4*x[0],2*x[1]]) …
Hi there!Today, I would like to introduce cvxopt to you. CVXOPT is a library for resolving convex optimization like linear programs, and it is written by Python.please be careful for other packages when you want to install this in Mac. bec…
This is the famous model for simulating the action potential of a neuron.In terms of neuroscience, the mechanism of an action potential is explained as like this. (1)When a membrane receives a stimulus, stimulus-dependent Na+ channels open…
(When I go back to Tokyo, I would like to comment on this code.)This code is mostly copied from the end of this site.... Neurdon #-*- coding:utf-8 -*- from __future__ import division import numpy as np import matplotlib.pyplot as plt class…
In this log, I am summarizing Neural Models' articles. Later, I would like to make gists of them with python codes.Spiking Neuron Models Single Neurons, Populations, Plasticity comments for modelsSTEPS: Modeling and Simulating Complex Reac…
#-*- coding:utf-8 -*- from datetime import datetime def smallest_num(n): counter = 0 num = n dict_num = {"0":0, "1":1, "2":2, "3":3, "4":2, "5":1, "6":2, "7":3, "8":4, "9":2} if n >= 1000: counter += num / 1000 num = num % 1000 for i, d in…
#-*- coding:utf-8 -*- import random from datetime import datetime #素数判定 def is_prime3(q,k=50): q = abs(q) if q == 2: return True if q < 2 or q&1 == 0: return False d = (q-1)>>1 while d&1 == 0: d >>= 1 for i in xrange(k): a = random.ran…
解き方的な #-*- coding:utf-8 -*- import random from datetime import datetime #素数判定 def is_prime3(q,k=50): q = abs(q) if q == 2: return True if q < 2 or q&1 == 0: return False d = (q-1)>>1 while d&1 == 0: d >>= 1 for i in xrange(k): a =…
#-*- coding: utf-8 -*- from datetime import datetime def Euler63(): total = 0 for i in xrange(1,10): counter = 1 length = len(str(i ** counter)) while counter == length: total += 1 counter += 1 length = len(str(i ** counter)) return total …
完全に敗北です。 くそコードだけども、仕方ない。 999999 -> 567だと気づけばもっと早いコードがかける。 が、考慮しても30秒しな縮まらず敗北感。 #-*- coding:utf-8 -*- from datetime import datetime def square_count(x, List1, List2): count_squar…
#-*- coding:utf-8 -*- import numpy as np import matplotlib.pyplot as plt def main(): count = 0 #counter delta_time = 0.001 #sec N = 10. # the number of firing per second DAp = 0.35e-6 #M the ititial value of the cons of DA Km = 4.98e-6 #M …
"問題35"交差判定の式を用いれば一発だったった。 #include <stdio.h> double intersection(double a, double b, double c,double d, double e,double f,double g,double h){ double tc, td; tc = (a - b) * (g - e) + (e - f) * (a - c); td = (a - b) * (h - e) + (</stdio.h>…
"問題0033"つまりは、BとCの一番上にある数よりも小さな数のボールがくれば、NOを出力すればいいだけ。 #include <stdio.h> int main(void){ int i, B, C,count, set, num[10]; scanf("%d", &set); for(i = 0; i < set; i++){ scanf("%d %d %d %d %d %d %d %d %d %d",</stdio.h>…
"問題0034"結局は、二つの列車の速度の比率から交わるポイントが導出できる。 v1:v2 = 列車1が進んだ距離/(全体の線路の長さ) : 列車2が進んだ距離/(全体の線路の長さ) #include <stdio.h> int main(void){ int i; int num[12]; double total, rate, sum; while(scan</stdio.h>…
ソシュールによれば「言語は差異の体系」でした。そして、ここで明らかになるのは 「言語の自律性」です。なぜなら、「差異の体系」は記号そのものが持つ特性であり、 それは発話や聴覚のような器官によって根本的には影響されず、恣意性によって定義さ れる…
前章の最後の節において、ソシュールにおける言語学の2つの軸に関する指摘を確認しました。 特に、いままで説明してきたソシュール独自の言葉は、静的な言語学を改めて研究するための準備 だとも指摘しています。ここでは、前章の最後のところで指摘した『…