Skip to content

Instantly share code, notes, and snippets.

@myxyy
myxyy / cartpole_ac.py
Last active August 13, 2023 13:59
CartPole-ActorCritic
# 参考:
# https://www.dskomei.com/entry/2022/03/13/114756
# ゼロから作るDeepLearning4強化学習編
import gymnasium as gym
import torch
import torch.nn as nn
import numpy as np
from torch.distributions import Categorical
class ActorCritic(nn.Module):
using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;
public class PlayerCollider : UdonSharpBehaviour
{
[SerializeField]
private GameObject _target;
import gymnasium as gym
import torch
import torch.nn as nn
class Q(nn.Module):
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(4,64)
self.fc2 = nn.Linear(64,128)
Shader "Unlit/DisplayMHE"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_ClipTh ("Clip Threshold", Range(0,1)) = 0.5
}
SubShader
{
Tags { "RenderType"="Opaque" }
@myxyy
myxyy / tba.py
Last active December 25, 2022 15:09
# 以下を参考にしてます
# https://github.com/machine-perception-robotics-group/MPRGDeepLearningLectureNotebook/blob/master/13_rnn/06_Transformer.ipynb
import copy
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from timm.models.layers import trunc_normal_
import pytorch_lightning as pl