Skip to content

Instantly share code, notes, and snippets.

@TadaoYamaoka
TadaoYamaoka / random_mahjong.ipynb
Created October 28, 2023 13:17
random_mahjong.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TadaoYamaoka
TadaoYamaoka / cmajiang.ipynb
Created October 27, 2023 14:17
cmajiang.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TadaoYamaoka
TadaoYamaoka / ppo_breakout.py
Created October 8, 2023 12:22
PyTorchによるPPO実装
from typing import NamedTuple
import gymnasium as gym
import numpy as np
import torch
from torch import nn
import torch.nn.functional as F
import torchvision.transforms as transforms
from torch.utils.tensorboard import SummaryWriter
writer = SummaryWriter()
@TadaoYamaoka
TadaoYamaoka / mate_sfen.py
Created July 22, 2023 07:23
mate_sfen.py
import argparse
import glob
import os
from tqdm import tqdm
from concurrent.futures import ThreadPoolExecutor, wait
from threading import Lock
import queue
from cshogi import *
from cshogi import CSA
from cshogi.usi.Engine import Engine
@TadaoYamaoka
TadaoYamaoka / qat_fx.py
Created May 27, 2023 03:23
Quantization Aware Training with FX Graph Mode
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torchvision
from torchvision import transforms
from torch.ao.quantization import get_default_qat_qconfig_mapping
from torch.ao.quantization.quantize_fx import prepare_qat_fx, convert_fx
@TadaoYamaoka
TadaoYamaoka / python_lib.cc
Created April 20, 2023 13:02
lyra/cli_example/python_lib.cc
#include "lyra/cli_example/encoder_main_lib.h"
#include "lyra/cli_example/decoder_main_lib.h"
#include <algorithm>
#include <cstdint>
#include <fstream>
#include <iterator>
#include <memory>
#include <optional>
#include <sstream>
const spreadSheetId = PropertiesService.getScriptProperties().getProperty('spreadSheetId');
const sheetName = 'topstories';
var sheetObj = SpreadSheetsSQL.open(spreadSheetId, sheetName);
const openApiKey = PropertiesService.getScriptProperties().getProperty('openApiKey');
const openApiUrl = 'https://api.openai.com/v1/chat/completions';
function getNewHackerNews() {
var storyIds = getTopStoryIds();
var stories = [];
@TadaoYamaoka
TadaoYamaoka / floodgate32-80.csv
Created December 31, 2022 02:04
中盤互角局面集(戦型分類)
We can't make this file beautiful and searchable because it's too large.
startpos moves 2g2f 8c8d 2f2e 8d8e 6i7h 4a3b 1g1f 7a7b 3i3h 9c9d 9g9f 1c1d 2e2d 2c2d 2h2d P*2c 2d2h 5a5b 5i6h 3c3d 4i5h 8e8f 8g8f 8b8f P*8g 8f8e 7g7f P*8f 8h2b+ 3a2b 8g8f 8e8f 7i8h 8f8b P*8g 6c6d 8h7g 7b6c 3g3f 5b4b 4g4f 7c7d 2i3g 8a7c 3h4g 6a6b 6g6f 8b8a 2h2i 2b3c 8g8f 4c4d 7h8g 6c5d 6h7h 6d6e 6f6e 5d6e 2i6i P*6d,先手イチゴ囲い|相掛かり
startpos moves 2g2f 8c8d 2f2e 8d8e 6i7h 4a3b 2e2d 2c2d 2h2d P*2c 2d2h 7a7b 3i3h 3c3d 3h2g 9c9d 9g9f 5a5b 2g3f 8e8f 8g8f 8b8f P*8g 8f8e 7g7f 7c7d 4g4f 7d7e 7f7e 8e7e 8h2b+ 3a2b 7i8h 9d9e 9f9e P*9f 9e9d 7e7d B*8b 9a9d P*9h 3d3e 3f4g 7d2d 2h2d 2c2d 4g3h,相掛かり
startpos moves 7g7f 4a3b 2g2f 8c8d 6i7h 8d8e 8h7g 3c3d 7i6h 3a4b 3i4h 4b3c 6g6f 5a4a 6h6g 2b3a 3g3f 6a5b 4g4f 7c7d 4h4g 5c5d 4i5h 7a6b 2i3g 6b7c 6f6e 6c6d 6g6f 7c6b 6e6d 3a6d 6f6e 8e8f 8g8f 6d8f 7g8f,先手ツノ銀雁木
@TadaoYamaoka
TadaoYamaoka / floodgate32-80.sfen
Created December 31, 2022 02:01
中盤互角局面集
This file has been truncated, but you can view the full file.
startpos moves 2g2f 8c8d 2f2e 8d8e 6i7h 4a3b 1g1f 7a7b 3i3h 9c9d 9g9f 1c1d 2e2d 2c2d 2h2d P*2c 2d2h 5a5b 5i6h 3c3d 4i5h 8e8f 8g8f 8b8f P*8g 8f8e 7g7f P*8f 8h2b+ 3a2b 8g8f 8e8f 7i8h 8f8b P*8g 6c6d 8h7g 7b6c 3g3f 5b4b 4g4f 7c7d 2i3g 8a7c 3h4g 6a6b 6g6f 8b8a 2h2i 2b3c 8g8f 4c4d 7h8g 6c5d 6h7h 6d6e 6f6e 5d6e 2i6i P*6d
startpos moves 2g2f 8c8d 2f2e 8d8e 6i7h 4a3b 2e2d 2c2d 2h2d P*2c 2d2h 7a7b 3i3h 3c3d 3h2g 9c9d 9g9f 5a5b 2g3f 8e8f 8g8f 8b8f P*8g 8f8e 7g7f 7c7d 4g4f 7d7e 7f7e 8e7e 8h2b+ 3a2b 7i8h 9d9e 9f9e P*9f 9e9d 7e7d B*8b 9a9d P*9h 3d3e 3f4g 7d2d 2h2d 2c2d 4g3h
startpos moves 7g7f 4a3b 2g2f 8c8d 6i7h 8d8e 8h7g 3c3d 7i6h 3a4b 3i4h 4b3c 6g6f 5a4a 6h6g 2b3a 3g3f 6a5b 4g4f 7c7d 4h4g 5c5d 4i5h 7a6b 2i3g 6b7c 6f6e 6c6d 6g6f 7c6b 6e6d 3a6d 6f6e 8e8f 8g8f 6d8f 7g8f
startpos moves 2g2f 8c8d 2f2e 8d8e 6i7h 4a3b 3i3h 7a7b 7g7f 8e8f 8g8f 8b8f 5i5h 3c3d 2e2d 2c2d 2h2d 5a4b 3g3f 7c7d 2d2b+ 3a2b B*5e 8f8h+ 7i8h B*7c 5e7c+ 8a7c B*4f B*6d 4f6d 6c6d 2i3g 1c1d B*4f P*2h P*8c P*8a 4i3i 6d6e 9g9f 6e6f
@TadaoYamaoka
TadaoYamaoka / 02_diffusion_models_from_scratch.ipynb
Last active December 8, 2023 01:30
02_diffusion_models_from_scratch.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.