728x90 반응형 SMALL adamw1 [PyTorch] optimizer 시각화 utils.py import numpy as npimport torchimport torch.nn as nnimport matplotlib.pyplot as pltfrom collections import defaultdict# XOR & Perceptrondef draw_function(func, return_fig=False): xx = torch.linspace(-5, 5, steps=1000) fig = plt.figure() plt.plot(xx.numpy(), func(xx).numpy()) plt.xlabel("x", fontdict={"fontsize":16}) plt.ylabel("y", fontdict={"fontsize":16}, rotation=0) .. 2024. 9. 4. 이전 1 다음 728x90 반응형 LIST