DeepLearning
-
LearningRateSchedulerDeepLearning 2023. 6. 20. 17:01
LearningRateScheduler 콜백 함수는 학습률(LearningRate)을 동적으로 조정할 수 있도록 해줍니다. 사용자가 지정한 함수에 따라 학습률이 epoch 마다 업데이트 됩니다. 아래처럼 내가 함수를 생성해야함 from tensorflow.keras.callbacks import LearningRateScheduler def schedule(epoch, learning_rate): # Define your learning rate schedule logic if epoch < 10: return learning_rate else: return learning_rate * 0.1 lr_scheduler = LearningRateScheduler(schedule) model.fit(x_tra..
-
Dense Layer 파라미터 개수 세기DeepLearning 2023. 5. 6. 16:25
데이터가 Layer 에 어떤 shape 으로 입력이 되고, 그럼 거기에는 어떤 shape의 가중치가 곱해지고, 그럼 결과는 어떤 shape으로 나올까? 가 굉장히 궁금함! 처음부터 차근차근 공부하려고 결심했음. 그래서 노드는 뭔지, 엣지는 뭔지, Layer는 뭔지 처음부터 다시 공부할 거임. 무튼. 공부하다가 기억하고 싶은 내용이 있어 글을 작성한다. 지금 작성하는 내용은 데이터가 Layer에 입력되면 어떤 shape 으로 가중치가 곱해질까~? 그리고 학습해야하는 파라미터 개수는 몇 개일까~? 하는 내용. 1. 테스트를 위한 데이터 준비. (5,2) shape 인 2차원 행렬을 생성한다. X_arr = array([[ 1.2 , 15.925 ], [ 1.20625, 15.925 ], [ 1.2 , 15...
-
BatchNormalization layerDeepLearning 2023. 5. 4. 19:33
Layer that normalizes its inputs. 입력을 정규화하는 계층입니다. Batch normalization applies a transformation that maintains the mean output close to 0 and the output standard deviation close to 1. 평균 출력을 0에 가깝게, 출력 표준 편차를 1에 가깝게 유지하는 변환을 적용합니다. Importantly, batch normalization works differently during training and during inference. 중요한 점은 배치 정규화가 학습 시(model.fit())와 추론(model.predict()) 시 다르게 작동한다는 점입니다. Durin..