Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.

dòng chảy :: hoạt động :: FakeQuantWithMinMaxVarsPerChannel

#include <array_ops.h>

Giả lượng tử hóa tensor 'đầu vào' kiểu float và một trong các hình dạng: [d] ,.

Tóm lược

[b, d] [b, h, w, d] qua mỗi kênh thả nổi minmax của shape [d] tới tensor 'đầu ra' có cùng hình dạng với inputs .

[min; max] xác định phạm vi kẹp cho dữ liệu inputs . các giá trị inputs được lượng tử hóa thành phạm vi lượng tử hóa ( [0; 2^num_bits - 1] khi narrow_range là sai và [1; 2^num_bits - 1] khi đúng) và sau đó được khử lượng tử hóa và đầu ra dưới dạng thả nổi trong [min; max] khoảng thời gian. num_bits là độ num_bits của lượng tử hóa; từ 2 đến 16, bao gồm.

Trước khi lượng tử hóa, các giá trị minmax được điều chỉnh theo logic sau. Nên có min <= 0 <= max . Nếu 0 không nằm trong dải giá trị, hành vi có thể không mong muốn: Nếu 0 < min < max : min_adj = 0max_adj = max - min . Nếu min < max < 0 : min_adj = min - maxmax_adj = 0 . Nếu min <= 0 <= max : scale = (max - min) / (2^num_bits - 1) , min_adj = scale * round(min / scale)max_adj = max + min_adj - min .

Hoạt động này có một gradient và do đó cho phép đào tạo các giá trị max minmax .

Tranh luận:

Lợi nhuận:

Người xây dựng và Người phá hủy

FakeQuantWithMinMaxVarsPerChannel (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max)
FakeQuantWithMinMaxVarsPerChannel (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max, const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs)

Thuộc tính công khai

operation
outputs

Chức năng công cộng

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

Các chức năng tĩnh công khai

NarrowRange (bool x)
NumBits (int64 x)

Cấu trúc

tensorflow :: ops :: FakeQuantWithMinMaxVarsPerChannel :: Attrs

Bộ thiết lập thuộc tính tùy chọn cho FakeQuantWithMinMaxVarsPerChannel .

Thuộc tính công khai

hoạt động

Operation operation

đầu ra

::tensorflow::Output outputs

Chức năng công cộng

FakeQuantWithMinMaxVarsPerChannel

 FakeQuantWithMinMaxVarsPerChannel(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  ::tensorflow::Input min,
  ::tensorflow::Input max
)

FakeQuantWithMinMaxVarsPerChannel

 FakeQuantWithMinMaxVarsPerChannel(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  ::tensorflow::Input min,
  ::tensorflow::Input max,
  const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs
)

nút

::tensorflow::Node * node() const 

toán tử :: tensorflow :: Đầu vào

 operator::tensorflow::Input() const 

toán tử :: tensorflow :: Đầu ra

 operator::tensorflow::Output() const 

Các chức năng tĩnh công khai

Phạm vi hẹp

Attrs NarrowRange(
  bool x
)

NumBits

Attrs NumBits(
  int64 x
)