Skip to content

Instantly share code, notes, and snippets.

import os
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.optim as optim
import torchvision
from scipy import integrate
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.optim as optim
import torchvision
from scipy import integrate
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
from unet import Unet
import math
from functools import partial
import torch
from einops import rearrange
from einops.layers.torch import Rearrange
from torch import einsum, nn
class SinusoidalPositionEmbeddings(nn.Module):
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.optim as optim
import torchvision
from scipy import integrate
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
from unet import Unet
import math
from functools import partial
import torch
from einops import rearrange
from einops.layers.torch import Rearrange
from torch import einsum, nn
class SinusoidalPositionEmbeddings(nn.Module):
@TadaoYamaoka
TadaoYamaoka / random_mahjong.ipynb
Created October 28, 2023 13:17
random_mahjong.ipynb
Loading
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
Loading
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