본문 바로가기

분류 전체보기51

VisualStudio Code에서 anaconda python 실행 시 numpy 애러 해결 https://stackoverflow.com/a/62531033 Importing the numpy c-extensions failed Importing the numpy c-extensions failed I installed python 3.7 on my windows system to work on visual studio code. Everything was going well, including using the libraries. I uninstalled python us... stackoverflow.com visual studio code에서 아나콘다를 사용하여 파이썬을 실행시 numpy 파이 모듈을 실행한다면 다음과 같은 애러가 발생할 수 있습니다. 그렇다면 위 링크에 들어가셔서 해당 .. 2022. 8. 28.
rel_ops를 통한 클래스 비교연산자 자동 구현 저는 C++에서 클래스를 설계할 때 귀찮은 부분중 하나가 비교연산자를 구현이라고 생각합니다. !,==,!= 6개나 되는 연산자를 오버로딩하는 것은 매우 번거롭죠. 하지만! 예상외로 C++에서는 rel_ops - C++ Reference 123456 namespace rel_ops { template bool operator!= (const T& x, const T& y) { return !(x==y); } template bool operator> (const T& x, const T& y) { return y bool operator= (const T& x, const T& y) { re cplusplus.com https://en.cppreference.com/w/cpp/utility/rel_ops/.. 2022. 8. 28.
pytorch를 통한 xor 게이트 학습 예제 코드 : https://github.com/MainForm/xorNet 코딩을 처음 시작할때 "hello world"를 출력하는 것처럼 딥 러닝을 학습할 때 가장 처음으로 접하는 것이 XOR를 학습하는 것이라고 생각합니다. 기본적인 AND 연산이나 OR 연산의 경우 간단히 직선으로 구분하여 문제를 해결 가능합니다. ​ 하지만 XOR의 경우에는 단순한 직선으로는 문제를 해결하지 못하고 곡선을 통해 문제를 해결하여야 합니다. ​ 코딩의 순서로 Dataset를 만들고 Model를 만들고 나서 학습을 진행하도록 하겠습니다. Dataset.py import torch from torch.utils.data import Dataset from random import randint class xorDataSe.. 2022. 8. 27.