컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: SparseSoftmax
#include <sparse_ops.h>
일괄 처리된 ND SparseTensor
에 소프트맥스를 적용합니다.
요약
입력은 논리적 형태 [..., B, C]
(여기서 N >= 2
)와 표준 사전순으로 정렬된 인덱스를 갖는 ND SparseTensor를 나타냅니다.
이 연산은 모양이 [B, C]
인 각 가장 안쪽 논리 부분행렬에 일반 tf.nn.softmax()
를 적용하는 것과 동일하지만 암시적으로 0인 요소는 참여하지 않는다는 점을 알아냅니다. 특히 알고리즘은 다음과 같습니다.
(1) tf.nn.softmax()
크기 C 차원을 따라 [B, C]
모양의 가장 안쪽 부분 행렬 각각의 조밀화된 뷰에 적용합니다. (2) 원래의 암시적 0 위치를 마스크합니다. (3) 나머지 요소를 다시 정규화합니다.
따라서 SparseTensor
결과는 정확히 동일한 0이 아닌 인덱스와 모양을 갖습니다.
인수:
- 범위: 범위 개체
- sp_indices: 2-D. SparseTensor에서 비어 있지 않은 값의 인덱스가 있는
NNZ x R
행렬(표준 순서). - sp_values: 1-D.
sp_indices
에 해당하는 비어 있지 않은 NNZ
값입니다. - sp_shape: 1-D. 입력 SparseTensor의 모양입니다.
보고:
-
Output
: 1-D. SparseTensor
결과에 대한 NNZ
값입니다.
공개 속성
공공 기능
마디
::tensorflow::Node * node() const
operator::tensorflow::Input() const
연산자::텐서플로우::출력
operator::tensorflow::Output() const
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# tensorflow::ops::SparseSoftmax Class Reference\n\ntensorflow::ops::SparseSoftmax\n==============================\n\n`#include \u003csparse_ops.h\u003e`\n\nApplies softmax to a batched N-D `SparseTensor`.\n\nSummary\n-------\n\nThe inputs represent an N-D SparseTensor with logical shape `[..., B, C]` (where `N \u003e= 2`), and with indices sorted in the canonical lexicographic order.\n\nThis op is equivalent to applying the normal `tf.nn.softmax()` to each innermost logical submatrix with shape `[B, C]`, but with the catch that *the implicitly zero elements do not participate*. Specifically, the algorithm is equivalent to the following:\n\n(1) Applies `tf.nn.softmax()` to a densified view of each innermost submatrix with shape `[B, C]`, along the size-C dimension; (2) Masks out the original implicitly-zero locations; (3) Renormalizes the remaining elements.\n\nHence, the `SparseTensor` result has exactly the same non-zero indices and shape.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- sp_indices: 2-D. `NNZ x R` matrix with the indices of non-empty values in a SparseTensor, in canonical ordering.\n- sp_values: 1-D. `NNZ` non-empty values corresponding to `sp_indices`.\n- sp_shape: 1-D. Shape of the input SparseTensor.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): 1-D. The `NNZ` values for the result `SparseTensor`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseSoftmax](#classtensorflow_1_1ops_1_1_sparse_softmax_1a64ec9c22eb2f8d50797cfb39eb94009d)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_indices, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_values, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` sp_shape)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_softmax_1ad2dc43b15de20c26df875d2e2f5e9191) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_sparse_softmax_1a94b1fda8269b6888396b9c165fdd28b1) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_sparse_softmax_1aabb6b649a7d5f3c8a9db2dea2c44ef1a)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_softmax_1af6f0269e4c290ac6b8234ba881dafe13)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_softmax_1a1fccadd0a530764ea2d1691045ebf2a5)`() const ` | ` ` ` ` |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### SparseSoftmax\n\n```gdscript\n SparseSoftmax(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input sp_indices,\n ::tensorflow::Input sp_values,\n ::tensorflow::Input sp_shape\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n```"]]