Welcome to JWN's note

Hello, World!

그래, 너 하고 싶은 거 다 해... 자세히보기

Dev/PYTHON 7

[torch] unsqueeze, cat, broadcasting, norm

unsqueezeimport torchx = torch.rand(2, 3)print(x.unsqueeze(1).size())출력 예시torch.Size([2, 1, 3])1개 차원 추가. 예를 들어, shape가 (5,3)인 텐서에 unsqueeze(0)을 하면 0번째에 1개 차원 추가, shape는 (1, 5, 3)으로 바뀜. shape가 (5,3)인 텐서에 unsqueeze(1)을 하면 1번째에 1개 차원 추가, shape는 (5, 1, 3)으로 바뀜. 다음은 unsqueeze와 동일하게 작동함.import torchinputs = torch.tensor([[1, 2], [2, 3], [2,4]])print(inputs[:, None, :].size(..

Dev/PYTHON 2024.12.28
dcor

energy_distance# 데이터셋 1: 정규분포gt = np.random.normal(0, 1, 1000)# 데이터셋 2: 동일한 정규분포x1 = np.random.normal(0, 1, 1000)# 데이터셋 3: 다른 분포x2 = np.random.uniform(-2, 2, 1000)# 에너지 거리 계산ed1 = compute_ed(x1, gt)ed2 = compute_ed(x2, gt)print("Energy Distance (x1 vs gt):", ed1) # 작아야 함print("Energy Distance (x2 vs gt):", ed2) # 커야 함출력 예시Energy Distance (x1 vs gt): 0.045321Energy Distance (x2 vs gt): 0.823145..

Dev/PYTHON 2024.12.28
녹스 앱플레이어 다운로드, 파이썬 설치, 클릭 구현 (pywin32)

1. NoxPlayer 다운로드https://kr.bignox.com/ Noxplayer – Fastest and Smoothest Android Emulator for PC & Mac – Free and SafePlay the most popular mobile games and run apps on PC with NoxPlayer, the best Android Emulator. Supports Android 9. Compatible with Windows & Mac. Much faster and more stable.www.bignox.com2. 파이썬 설치https://www.python.org/ Welcome to Python.orgThe official home of the Python Pro..

Dev/PYTHON 2024.08.11