250x250
반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- GCP
- Retry
- 공분산
- chatGPT
- spark udf
- requests
- API Gateway
- grad-cam
- BigQuery
- flask
- API
- top_k
- gather_nd
- airflow subdag
- GenericGBQException
- integrated gradient
- UDF
- TensorFlow
- XAI
- Airflow
- Counterfactual Explanations
- 상관관계
- hadoop
- correlation
- session 유지
- tensorflow text
- subdag
- login crawling
- 유튜브 API
- youtube data
Archives
- Today
- Total
목록TensorFlow (1)
데이터과학 삼학년
[Tensorflow] tf.math.top_k을 이용해서 probs, indices를 한번에!
텐서플로우에도 파이토치의 top_k처럼 모델이 output으로 내뱉는 결과중 상위 k개를 뽑아내는 함수가 있다. tf.math.top_k(output, k) 이 것을 통하면 prob과 indices를 한번에 확인 가능하다!!! import tensorflow as tf # 라벨 딕셔너리 정의 label_dict = {0: 'cat', 1: 'dog', 2: 'bird'} # 가장 높은 값과 인덱스 찾기 values, indices = tf.math.top_k(output, k=1) print("Predicted index:", indices.numpy()[0])print("Predicted value:", values.numpy()[0]) @tf.function(input_signature=[tf.Ten..
Machine Learning
2023. 3. 18. 12:55