バイナリ変調モデル (Binary modulation)

models モジュールのうち、バイナリネットを構成する変調にかかわるモデルです。

RealToBinary class

class binarybrain.models.RealToBinary(*, input_shape=None, frame_modulation_size=1, depth_modulation_size=1, value_generator=None, framewise=False, input_range_lo=0.0, input_range_hi=1.0, name=None, bin_dtype=DType.FP32, real_dtype=DType.FP32, core_model=None)

ベースクラス: Model

RealToBinary class

実数値をバイナリ値に変換する。 バイナリ変調機能も有しており、フレーム方向に変調した場合フレーム数(=ミニバッチサイズ)が 増える。 またここでビットパッキングが可能であり、32フレームのbitをint32に詰め込みメモリ節約可能である

パラメータ
  • frame_modulation_size (int) -- フレーム方向への変調数(フレーム数が増える)

  • depth_modulation_size (int) -- Depth方向への変調数(チャンネル数が増える)

  • framewise (bool) -- Trueで変調閾値をフレーム単位とする(Falseでピクセル単位)

  • bin_dtype (DType) -- 出力の型を bb.DType.FP32 もしくは bb.DType.BIT で指定可能

BinaryToReal class

class binarybrain.models.BinaryToReal(*, frame_integration_size=1, depth_integration_size=1, output_shape=None, input_shape=None, name=None, bin_dtype=DType.FP32, real_dtype=DType.FP32, core_model=None)

ベースクラス: Model

BinaryToReal class

バイナリ値を実数値に戻す。その際にフレーム方向に変調されたデータを積算して 元に戻すことが可能である

パラメータ
  • frame_integration_size (int) -- フレーム方向の積算サイズ数(フレーム変調の統合)

  • depth_integration_size (int) -- チャンネル方向の積算サイズ(0の時はoutput_shape優先)

  • output_shape (List[int]) -- 出力のシェイプ(指定が無ければ入力と同じshape)

  • bin_dtype (DType) -- 入力の型を bb.DType.FP32 もしくは bb.DType.BIT で指定可能

BitEncode class

class binarybrain.models.BitEncode(bit_size=1, *, output_shape=None, input_shape=None, name=None, bin_dtype=DType.FP32, real_dtype=DType.FP32, core_model=None)

ベースクラス: Model

BitEncode class

実数値をバイナリ表現としてdepth方向に展開する

パラメータ

bit_size (int) -- エンコードするbit数

Reduce class

class binarybrain.models.Reduce(output_shape=None, integration_size=0, *, input_shape=None, name=None, bin_dtype=DType.FP32, real_dtype=DType.FP32, core_model=None)

ベースクラス: Model

Reduce class

多重化されている出力を折り返して積和する

パラメータ
  • output_shape ([int]) -- 出力のシェイプ

  • integration_size (int) -- 積算するサイズ