Minimizing cumulative error.

4 ビュー (過去 30 日間)
Piotr Lenarczyk
Piotr Lenarczyk 2017 年 12 月 18 日
コメント済み: Rena Berman 2017 年 12 月 26 日
Please do consider separate accumulation within loops with periodical usage of C++:
typedef struct
{
float someFloat;
long long unsigned int extractMedianValue = 0;
} separateAccumulate;
Please consider making function for providing single as default Matlab variable.
  2 件のコメント
Jan
Jan 2017 年 12 月 18 日
It is not clear what you are asking for. Matlab default type is double and you cannot change this. If you question concerns C++, this is the wrong forum.
Rena Berman
Rena Berman 2017 年 12 月 26 日
(Answers Dev) Restored edit

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 12 月 18 日
As indicated in your other Question, changing the default type can be done with
feature('SetPrecision', 24)
However, this is at odds with "minimizing cumulative error": you can reduce cumulative error by using higher precision variables.
Heavy use of exclusively single precision values is typically associated with deep learning and Recurrent networks. Those are, however, typically computed on GPU, in which case you would need a version of NVIDIA's deep learning GPU kernels written using algorithms to minimize cumulative errors; routines at the MATLAB level would not be useful in that situation.
When I look at your C++ code, it does not appear to me that you are using Donal Knuth's algorithm from The Art Of Computer Programming; you should consider using that. Unfortunately in the time I spent searching I do not happen to find a link to it.

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by