View audio2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 正弦波を出力する。引数でバッファサイズを指定 | |
* (※SDLのドキュメントでは AudioSpec::samples はサンプル数って書いて | |
* るけど、実際はバッファサイズだと思う) | |
* | |
* メインスレッドで音を溜めてコールバックで出力する方式 | |
* スレッド間のデータのやりとりに boost::lockfree::spsc_queue を使用 | |
*/ | |
#include <string> |
View audio.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
#--------------------------------------------------------------------- | |
# SDL2で正弦波を出力する。引数でバッファサイズを指定 | |
# | |
# コールバック方式。PythonのGILがどう影響するかの検証 | |
# スレッド間のやりとりにはとりあえず標準の queue を使用 | |
#--------------------------------------------------------------------- |
View FrozenLake4x4-handmade.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Just a handmade algorithm. NOT AI. | |
import gym | |
### MAP ### | |
# SFFF | |
# FHFH |
View FrozenLake-handmade.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Just a handmade algorithm. NOT AI. | |
import sys | |
import gym | |
### 4x4 MAP ### |
View FrozenLake4x4-interactive.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import gym | |
def get_action(): | |
while True: | |
try: | |
act = int(input("--- direction(0:L, 1:D, 2:R, 3:U) > ")) | |
return act |
View FrozenLake-handmade.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Just a handmade algorithm. NOT AI. | |
import sys | |
import gym | |
### 4x4 MAP ### |
View judge.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import json | |
import numpy as np | |
def error(msg): |
View FrozenLake-random.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import gym | |
DEBUG = False | |
#DEBUG = True |
View FrozenLake-qlearning.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Q学習 | |
# 探索時ランダムプレイ | |
import sys | |
import os.path | |
import pprint |
View FrozenLake-qlearning2.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Q学習 | |
# 探索時e-greedy | |
import sys | |
import random | |
import os.path | |
import pprint |
OlderNewer