본문 바로가기

code정리(python)4

[ PyTorch ] PyTorch 설치하기( with 아나콘다) Pytorch 설치 방법 1. PyTorch 홈페이지에서 pytorch 설치 commend 확인 pytorch.org/get-started/locally/ PyTorch An open source deep learning platform that provides a seamless path from research prototyping to production deployment. pytorch.org Get Started를 클릭하면 화면에 START LOCALLY창이 보이고, 설정에 맞게 클릭 후 제일 하단에 있는 RUN this Command 를 확인한다. ※ CUDA 버전 확인 방법 >>>nvcc -V or >>>nvidia-smi 홈페이지에서 얻은 명령어를 가지고 pytorch를 설치한다. 2. .. 2020. 12. 1.
교차검증(Cross-Validation) scikit-learn.org/stable/modules/cross_validation.html 3.1. Cross-validation: evaluating estimator performance — scikit-learn 0.23.2 documentation 3.1. Cross-validation: evaluating estimator performance Learning the parameters of a prediction function and testing it on the same data is a methodological mistake: a model that would just repeat the labels of the samples that it has just seen would h.. 2020. 11. 26.
[pandas] DataFrame 컬럼 이름 변경하기 new_name=[] for i in df_new.columns: new_name.append(i.split()[0]) df_new_dic=dic(zip(df_new.columns,new_name)) df_new.rename(columns=df_new_dic,inplace=True) 2020. 11. 25.
[Keras] 학습 모델 저장하고 불러오기 딥러닝 모델을 학습진행할 때 시간이 많이 소요된다. 환경에 따라 다르겠지만 많게는 수십시간이 걸릴때가 있다. 어렵게 학습시킨 모델을 한번만 쓰고 버릴수는 없을 것이다. 어떻게 하면 귀중한 모델을 재사용할 수 있을까. 모델 저장 방법은 의외로 간단하다. (상세한 내용은 아래 링크) www.tensorflow.org/api_docs/python/tf/keras/models/load_model tf.keras.models.load_model | TensorFlow Core v2.3.0 Loads a model saved via model.save(). www.tensorflow.org Model Save 1. 먼저 keras.models.load_model을 import 한다. 2. model.save() 메.. 2020. 11. 23.