#include <convolve.h>
|
| Convolve (const STRING &name, int ni, int half_x, int half_y) |
|
| ~Convolve () override=default |
|
STRING | spec () const override |
|
bool | Serialize (TFile *fp) const override |
|
bool | DeSerialize (TFile *fp) override |
|
void | Forward (bool debug, const NetworkIO &input, const TransposedArray *input_transpose, NetworkScratch *scratch, NetworkIO *output) override |
|
bool | Backward (bool debug, const NetworkIO &fwd_deltas, NetworkScratch *scratch, NetworkIO *back_deltas) override |
|
| Network () |
|
| Network (NetworkType type, const STRING &name, int ni, int no) |
|
virtual | ~Network ()=default |
|
NetworkType | type () const |
|
bool | IsTraining () const |
|
bool | needs_to_backprop () const |
|
int | num_weights () const |
|
int | NumInputs () const |
|
int | NumOutputs () const |
|
virtual StaticShape | InputShape () const |
|
virtual StaticShape | OutputShape (const StaticShape &input_shape) const |
|
const STRING & | name () const |
|
bool | TestFlag (NetworkFlags flag) const |
|
virtual bool | IsPlumbingType () const |
|
virtual void | SetEnableTraining (TrainingState state) |
|
virtual void | SetNetworkFlags (uint32_t flags) |
|
virtual int | InitWeights (float range, TRand *randomizer) |
|
virtual int | RemapOutputs (int old_no, const std::vector< int > &code_map) |
|
virtual void | ConvertToInt () |
|
virtual void | SetRandomizer (TRand *randomizer) |
|
virtual bool | SetupNeedsBackprop (bool needs_backprop) |
|
virtual int | XScaleFactor () const |
|
virtual void | CacheXScaleFactor (int factor) |
|
virtual void | Update (float learning_rate, float momentum, float adam_beta, int num_samples) |
|
virtual void | CountAlternators (const Network &other, double *same, double *changed) const |
|
void | DisplayForward (const NetworkIO &matrix) |
|
void | DisplayBackward (const NetworkIO &matrix) |
|
Definition at line 32 of file convolve.h.
◆ Convolve()
tesseract::Convolve::Convolve |
( |
const STRING & |
name, |
|
|
int |
ni, |
|
|
int |
half_x, |
|
|
int |
half_y |
|
) |
| |
◆ ~Convolve()
tesseract::Convolve::~Convolve |
( |
| ) |
|
|
overridedefault |
◆ Backward()
Implements tesseract::Network.
Definition at line 84 of file convolve.cpp.
87 back_deltas->Resize(fwd_deltas,
ni_);
88 NetworkScratch::IO delta_sum;
89 delta_sum.ResizeFloat(fwd_deltas,
ni_, scratch);
92 StrideMap::Index src_index(fwd_deltas.stride_map());
95 int t = src_index.t();
98 StrideMap::Index x_index(src_index);
99 if (x_index.AddOffset(x,
FD_WIDTH)) {
102 StrideMap::Index y_index(x_index);
104 fwd_deltas.AddTimeStepPart(t, out_iy,
ni_,
105 delta_sum->f(y_index.t()));
110 }
while (src_index.Increment());
111 back_deltas->CopyAll(*delta_sum);
◆ DeSerialize()
bool tesseract::Convolve::DeSerialize |
( |
TFile * |
fp | ) |
|
|
overridevirtual |
◆ Forward()
Implements tesseract::Network.
Definition at line 50 of file convolve.cpp.
53 output->Resize(input,
no_);
55 StrideMap::Index dest_index(output->stride_map());
58 int t = dest_index.t();
61 StrideMap::Index x_index(dest_index);
62 if (!x_index.AddOffset(x,
FD_WIDTH)) {
68 StrideMap::Index y_index(x_index);
73 output->CopyTimeStepGeneral(t, out_iy,
ni_, input, y_index.t(), 0);
78 }
while (dest_index.Increment());
◆ Serialize()
bool tesseract::Convolve::Serialize |
( |
TFile * |
fp | ) |
const |
|
overridevirtual |
◆ spec()
STRING tesseract::Convolve::spec |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ half_x_
int32_t tesseract::Convolve::half_x_ |
|
protected |
◆ half_y_
int32_t tesseract::Convolve::half_y_ |
|
protected |
The documentation for this class was generated from the following files: