단층퍼셉트론 (1) 썸네일형 리스트형 [ML] 단층 퍼셉트론으로 XOR 문제 구현하기 1. 파이토치로 단층 퍼셉트론 구현하기 필요한 도구들을 불러옵니다. import torch import torch.nn as nn import torch.optim as optimGPU 연산이 가능할 경우 GPU 연산을 할 수 있도록 설정해줍니다. 지금은 cpu로 연산을 진행하겠네요. # GPU 연산이 가능할 경우에 GPU 연산을 할 수 있도록 설정 device = 'cuda' if torch.cuda.is_available() else 'cpu' torch.manual_seed(777) if device == 'cuda': torch.cuda.manual_seed_all(777) print(f'연산 장치 : {device}')XOR 문제에 해당하.. 이전 1 다음