tensorflow tf.math.reduce_mean()

사용 버전: Python 3.7.6, Tensorflow 2.1.0


tensorflow(텐서플로우) tf.math.reduce_mean()에 대해서 알아보겠습니다.

괄호 안에는 input_tensor, axis, keepdims, name 따위가 들어갑니다.

tf.math.reduce_mean()은 배열의 평균값을 구합니다.











axis 속성을 사용하면, 해당 axis 끼리의 평균을 구합니다. 지금은 7x10이기 때문에 평균을 낼 때, axis 0은 7을 제거, axis 1은 10을 제거합니다.
axis=0







axis=1










keepdims는 참, 거짓이 들어가며, 참일 시에는 위처럼 (7, ) 이런 벡터 모양이 아닌 (7,1)처럼 배열 형태를 유지합니다.










끝.



카테고리: Tensorflow_python, Python

댓글

이 블로그의 인기 게시물

Python urllib.parse.quote()

KiCad 시작하기 4 (기존 회로도 수정 및 추가)

Android Notification with Full Screen

딩기 요트 명칭

Android App architecture: State holders and UI state

KiCad 시작하기 3 (새로운 소자 추가하기)

tensorflow tf.expand_dims()

외동 휴게소(부산 방향) 추천 메뉴

Android Room database FTS

서브넷 마스크 계산하기