Loading...
2023. 9. 13. 00:34

구현하면서 배우는 batch normalization에 대한 몇가지 핵심사항

면접에서 batch normalization이 training하기 전에 실행하냐? training하면서 실행하냐? 이런걸 물어봤는데 batch normalization에 대해 몇가지를 배워보자 1. 핵심 아이디어 The idea is that, instead of just normalizing the inputs to the network, we normalize the inputs to layers within the network. network에 대한 input을 normalizing하는 것 대신에 network 내부의 layer에 대한 input을 normalizing함 It's called batch normalization because during training, we normalize e..

2023. 4. 24. 03:53

pytorch를 이용한 inference process 기본기 완벽하게 이해하기 & pytorch lightning

1. model.eval() model.train()과 비슷하게 model을 evaluation mode로 바꾸는 것 evaluation 전에 반드시 설정하는 것이 좋다 batchnorm이나 dropout같은 것들이 training과정과 evalutation과정에서 다르게 동작해야해서 설정해주는 것이 의미 있다 실제로 쓰지 않으면.. 결과가 매우 다르기 때문에 잊지말고 사용해야한다. 2. with torch.no_grad() evaluation은 단지 검증과정이다. 중간에 model의 parameter가 update된다면 문제가 있음 무슨 말이냐면 training 단계에서 update된 parameter를 가지고 evaluation하고 싶은거지 inference과정에서 따로 parameter를 또 upd..

2023. 4. 24. 03:23

pytorch를 이용한 training process 기본기 완벽하게 이해하기

1. training을 위해 필요한 것? training을 위해 dataset, dataloader를 준비해서 data를 효율적으로 뽑아낼 준비를 했고 설계한 model과 loss, optimizer, learning rate, scheduler, metric 등을 준비했다면 학습 준비 완료! 2. model.train() train하기 전에 model을 trainable하게 변경시키는 함수? 그런데 분명 model 설계할 때 나는 각종 parameter의 requires_grad=True로 한것같은데 굳이 해야하나??? batchnorm이나 dropout같은 것이 training 과정이랑 evaluation 과정에서 다르게 작동해야한다고 알려져있어서 train mode와 eval mode를 구분하기 위..