2025451021
인공지능학과
김영수
On the Effect of Negative-Pair Variance in Contrastive Learning and a VRN-Based Solution
import random | |
import numpy as np | |
from visualize_train import draw_value_image, draw_policy_image | |
# left, right, up, down | |
ACTIONS = [np.array([0, -1]), | |
np.array([0, 1]), | |
np.array([-1, 0]), |
import numpy as np | |
from numpy.linalg import inv | |
from visualize_train import draw_value_image, draw_policy_image | |
# left, right, up, down | |
ACTIONS = [np.array([0, -1]), | |
np.array([0, 1]), | |
np.array([-1, 0]), | |
np.array([1, 0])] |
"""Showcase of flying arrows that can stick to objects in a somewhat | |
realistic looking way. | |
""" | |
import sys | |
from typing import List | |
import pygame | |
import pymunk |
import torch | |
from torch import initial_seed | |
directs = [(1, 0), (-1, 0), (0, 1), (0, -1)] # [down, up, right, left] | |
inf = int(1e9) | |
def initialize_policy(width, height, terminals): | |
policy = torch.full((height, width, 4), 0.0) | |
for y in range(height): | |
for x in range(width): |