Google I/O-তে টিউন করার জন্য ধন্যবাদ। চাহিদা অনুযায়ী সব সেশন দেখুন চাহিদা অনুযায়ী দেখুন

সেন্সরফ্লো :: অপস :: ম্যাট্রিক্সসেটডিয়াভিভি 2

#include <array_ops.h>

নতুন ব্যাচযুক্ত তির্যক মানগুলির সাথে একটি ব্যাচযুক্ত ম্যাট্রিক্স টেনসর ফিরিয়ে দেয়।

সারসংক্ষেপ

input এবং diagonal , এই অপারেশনটি আন্তঃতম ম্যাট্রিকগুলির নির্দিষ্ট বর্ণগুলি বাদ দিয়ে একই আকার এবং input হিসাবে মানগুলির সাথে একটি টেনসর দেয়। এগুলি diagonal মানগুলির দ্বারা ওভাররাইট করা হবে।

input r+1 মাত্রা রয়েছে [I, J, ..., L, M, N] যখন k স্কালে বা k[0] == k[1] , diagonal হয়েছে r মাত্রা [I, J, ..., L, max_diag_len] । অন্যথায়, এর r+1 মাত্রা রয়েছে [I, J, ..., L, num_diags, max_diag_len]num_diags হল num_diags সংখ্যা, num_diags = k[1] - k[0] + 1max_diag_len [k[0], k[1]] , max_diag_len = min(M + min(k[1], 0), N + min(-k[0], 0))

আউটপুটটি হ'ল মাত্রা [I, J, ..., L, M, N] সহ k+1 র‌্যাঙ্কের একটি সেন্সর। k যদি স্কেলার হয় বা k[0] == k[1] :

output[i, j, ..., l, m, n]
  = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
    output[i, j, ..., l, m, n]             ; otherwise

অন্যথায়,

output[i, j, ..., l, m, n]
  = diagonal[i, j, ..., l, k[1]-d, n-max(d, 0)] ; if d_lower <= d <= d_upper
    input[i, j, ..., l, m, n]                   ; otherwise
যেখানে d = n - m

উদাহরণ স্বরূপ:

# The main diagonal.
input = np.array([[[7, 7, 7, 7],              # Input shape: (2, 3, 4)
                   [7, 7, 7, 7],
                   [7, 7, 7, 7]],
                  [[7, 7, 7, 7],
                   [7, 7, 7, 7],
                   [7, 7, 7, 7]]])
diagonal = np.array([[1, 2, 3],               # Diagonal shape: (2, 3)
                     [4, 5, 6]])
tf.matrix_diag(diagonal) ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
                               [7, 2, 7, 7],
                               [7, 7, 3, 7]],
                              [[4, 7, 7, 7],
                               [7, 5, 7, 7],
                               [7, 7, 6, 7]]]

# A superdiagonal (per batch).
tf.matrix_diag(diagonal, k = 1)
  ==> [[[7, 1, 7, 7],  # Output shape: (2, 3, 4)
        [7, 7, 2, 7],
        [7, 7, 7, 3]],
       [[7, 4, 7, 7],
        [7, 7, 5, 7],
        [7, 7, 7, 6]]]

# A band of diagonals.
diagonals = np.array([[[1, 2, 3],  # Diagonal shape: (2, 2, 3)
                       [4, 5, 0]],
                      [[6, 1, 2],
                       [3, 4, 0]]])
tf.matrix_diag(diagonals, k = (-1, 0))
  ==> [[[1, 7, 7, 7],  # Output shape: (2, 3, 4)
        [4, 2, 7, 7],
        [0, 5, 3, 7]],
       [[6, 7, 7, 7],
        [3, 1, 7, 7],
        [7, 4, 2, 7]]]

  

Arguments:

  • scope: A Scope object
  • input: Rank r+1, where r >= 1.
  • diagonal: Rank r when k is an integer or k[0] == k[1]. Otherwise, it has rank r+1. k >= 1.
  • k: Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main diagonal, and negative value means subdiagonals. k can be a single integer (for a single diagonal) or a pair of integers specifying the low and high ends of a matrix band. k[0] must not be larger than k[1].

Returns:

  • Output: Rank r+1, with output.shape = input.shape.

Constructors and Destructors

MatrixSetDiagV2(const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input diagonal, ::tensorflow::Input k)

Public attributes

operation
output

Public functions

node() const
::tensorflow::Node *
operator::tensorflow::Input() const
operator::tensorflow::Output() const

Public attributes

operation

Operation operation

আউটপুট

::tensorflow::Output output

পাবলিক ফাংশন

ম্যাট্রিক্সসেটডিয়াভিভি 2

 MatrixSetDiagV2(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input diagonal,
  ::tensorflow::Input k
)

নোড

::tensorflow::Node * node() const 

অপারেটর :: টেনসরফ্লো :: ইনপুট

 operator::tensorflow::Input() const 

অপারেটর :: টেনসরফ্লো :: আউটপুট

 operator::tensorflow::Output() const