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
- 공분산
- grad-cam
- youtube data
- session 유지
- 상관관계
- login crawling
- XAI
- Counterfactual Explanations
- subdag
- correlation
- Airflow
- integrated gradient
- flask
- API Gateway
- API
- top_k
- airflow subdag
- Retry
- GCP
- requests
- GenericGBQException
- TensorFlow
- chatGPT
- UDF
- hadoop
- tensorflow text
- spark udf
- gather_nd
- BigQuery
- 유튜브 API
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