교 향
Maximalism
교 향
전체 방문자
오늘
어제
  • 전체글
    • Coding
    • Linux
    • Docker
    • Python
    • AI
      • GPT
      • Pandas
      • Numpy
      • tensorflow
      • pytorch
      • openCV
      • Study
      • AIconnect - [GPT]한국어..
    • Data structure, OS
    • Competitions
    • Investment
    • Book
    • Health
    • Trip
    • Memo
    • 대학원

블로그 메뉴

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

공지사항

인기 글

태그

  • AI면접 #딥러닝면접 #인공지능면접 #기울기소실 #GradientVanishing
  • ActivationFunction #활성화함수 #인공지능면접

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
교 향

Maximalism

AI/tensorflow

[keras] predict_on_batch 와 predict의 차이 ?

2023. 2. 1. 11:03

What is the difference between the predict and predict_on_batch methods of a Keras model?

 

What is the difference between the predict and predict_on_batch methods of a Keras model?

According to the keras documentation: predict_on_batch(self, x) Returns predictions for a single batch of samples. However, there does not seem to be any difference with the standard predict method

stackoverflow.com

 

predict와 predict_on_batch는 기능적 차이는 크게 없고

predict에 추가적 동작(배치 컬렉션이 제대로 동작하는지 확인하는??)이 부과되어 있는 듯 했음

 

predict는 모든 데이터를 배치by배치로 예측 수행 (네트워크에 매번 배치단위로 데이터를 넣음)

predict_on_batch는 정확히 하나의 배치로 데이터를 가정하고 네트워크로 넣음

predict_on_batch가 predict보다 속도면에서도 빠른 모습.

 

그래서 내가 테스트 해보고 싶은 데이터단을 정확히 하나의 배치로 두고

predict할 것이라면 predict_on_batch를 사용하는 편이 좋을 듯?

'AI > tensorflow' 카테고리의 다른 글

학습 중지된 경우 이어서 하려면?  (0) 2023.09.19
[Tensorflow] EfficientNet 예제  (0) 2023.02.14
AttributeError: 'Functional' object has no attribute 'predict_proba'  (0) 2023.01.27
[tf.data] data transform하여 dataset 추가하기  (0) 2022.12.22
자주 사용하는 Tensor함수 정리  (0) 2022.12.22
    'AI/tensorflow' 카테고리의 다른 글
    • 학습 중지된 경우 이어서 하려면?
    • [Tensorflow] EfficientNet 예제
    • AttributeError: 'Functional' object has no attribute 'predict_proba'
    • [tf.data] data transform하여 dataset 추가하기
    교 향
    교 향
    AI/ML/DL

    티스토리툴바