tensorflow:: ops:: Dequantize
#include <array_ops.h>'ইনপুট' টেনসরটিকে একটি ফ্লোট টেনসরে ডিকোয়ান্টাইজ করুন ।
সারসংক্ষেপ
[min_range, max_range] হলো স্কেলার ফ্লোট যা আউটপুটের পরিসর নির্দিষ্ট করে। 'mode' অ্যাট্রিবিউটটি নিয়ন্ত্রণ করে যে ফ্লোট মানগুলিকে তাদের কোয়ান্টাইজড সমতুল্যে রূপান্তর করার জন্য ঠিক কোন গণনাগুলি ব্যবহার করা হবে।
'MIN_COMBINED' মোডে, টেনসরের প্রতিটি মানের নিম্নলিখিত পরিবর্তন ঘটবে:
if T == qint8: in[i] += (range(T) + 1)/ 2.0 out[i] = min_range + (in[i]* (max_range - min_range) / range(T))
range(T) = numeric_limits ::max() - numeric_limits ::min() MIN_COMBINED মোডের উদাহরণ
যদি ইনপুট QuantizedRelu6 থেকে আসে, তাহলে আউটপুট টাইপ হবে quint8 (রেঞ্জ ০-২৫৫), কিন্তু QuantizedRelu6- এর সম্ভাব্য রেঞ্জ হলো ০-৬। সুতরাং min_range এবং max_range-এর মান হবে যথাক্রমে ০.০ এবং ৬.০। quint8-এর উপর Dequantize অপারেশনটি প্রতিটি মানকে float-এ কাস্ট করবে এবং 6 / 255 দিয়ে গুণ করবে। উল্লেখ্য যে, যদি quantizedtype qint8 হয়, তাহলে অপারেশনটি কাস্ট করার আগে প্রতিটি মানের সাথে অতিরিক্তভাবে ১২৮ যোগ করবে।
যদি মোড 'MIN_FIRST' হয়, তাহলে এই পদ্ধতিটি ব্যবহার করা হয়:
num_discrete_values = 1 << (# of bits in T) range_adjust = num_discrete_values / (num_discrete_values - 1) range = (range_max - range_min) * range_adjust range_scale = range / num_discrete_values const double offset_input = static_cast(input) - lowest_quantized; result = range_min + ((input - numeric_limits ::min()) * range_scale)
মোডটি SCALED হলে, প্রতিটি ইনপুট মানকে একটি স্কেলিং_ফ্যাক্টর দিয়ে গুণ করে ডিকোয়ান্টাইজেশন করা হয়। (ফলে ০-এর একটি ইনপুট সর্বদা ০.০-তে ম্যাপ করে)।
QuantizeAndDequantize{V2|V3} এবং QuantizeV2 এর সাথে সামঞ্জস্যপূর্ণভাবে, নিম্নলিখিত অ্যালগরিদম ব্যবহার করে min_range , max_range এবং narrow_range থেকে scaling_factor নির্ধারণ করা হয়:
const int min_expected_T = std::numeric_limits::min() + (narrow_range ? 1 : 0); const int max_expected_T = std::numeric_limits ::max(); const float max_expected_T = std::numeric_limits ::max();
const float scale_factor = (std::numeric_limits::min() == 0) ? (max_range / max_expected_T) : std::max(min_range / min_expected_T, max_range / max_expected_T);
যুক্তি:
- স্কোপ: একটি স্কোপ অবজেক্ট
- min_range: ইনপুটের জন্য সম্ভাব্য সর্বনিম্ন স্কেলার মান।
- max_range: ইনপুটের জন্য সম্ভাব্য সর্বোচ্চ স্কেলার মান।
ফেরত:
-
Output: আউটপুট টেনসর।
নির্মাতা এবং ধ্বংসকারী | |
|---|---|
Dequantize (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input min_range, :: tensorflow::Input max_range) | |
Dequantize (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input min_range, :: tensorflow::Input max_range, const Dequantize::Attrs & attrs) |
জনসাধারণের বৈশিষ্ট্য | |
|---|---|
operation | |
output | |
জনসাধারণের কার্যাবলী | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
পাবলিক স্ট্যাটিক ফাংশন | |
|---|---|
Axis (int64 x) | |
Mode (StringPiece x) | |
NarrowRange (bool x) | |
কাঠামো | |
|---|---|
| tensorflow:: ops:: Dequantize:: Attrs | Dequantize-এর জন্য ঐচ্ছিক অ্যাট্রিবিউট সেটার। |
জনসাধারণের বৈশিষ্ট্য
অপারেশন
Operation operation
আউটপুট
::tensorflow::Output output
জনসাধারণের কার্যাবলী
ডিকুয়ান্টাইজ করুন
Dequantize( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input min_range, ::tensorflow::Input max_range )
ডিকুয়ান্টাইজ করুন
Dequantize( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input min_range, ::tensorflow::Input max_range, const Dequantize::Attrs & attrs )
নোড
::tensorflow::Node * node() const
অপারেটর::টেনসরফ্লো::ইনপুট
operator::tensorflow::Input() const
অপারেটর::টেনসরফ্লো::আউটপুট
operator::tensorflow::Output() const
পাবলিক স্ট্যাটিক ফাংশন
অক্ষ
Attrs Axis( int64 x )
মোড
Attrs Mode( StringPiece x )
সংকীর্ণ পরিসর
Attrs NarrowRange( bool x )