Re: D Mir: standard deviation speed

2020-07-15 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 07:51:31 UTC, 9il wrote: On Wednesday, 15 July 2020 at 07:34:59 UTC, tastyminerals wrote: On Wednesday, 15 July 2020 at 06:57:21 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:55:51 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:00:46 UTC, tastyminerals

[OT] Re: D Mir: standard deviation speed

2020-07-15 Thread Schrom, Brian T via Digitalmars-d-learn
> I've mixed up @fastmath and @fmamath as well. No worries. Seems like this might be a good awareness opportunity to change one of the names to be more descriptive and more distinctive. FWIW, I read half way through threw the thread before I caught onto the distinction. I can imagine making that

Re: D Mir: standard deviation speed

2020-07-15 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 11:41:35 UTC, 9il wrote: [snip] Ah, no, my bad! You write @fmamath, I have read it as @fastmath. @fmamath is OK here. I've mixed up @fastmath and @fmamath as well. No worries.

Re: D Mir: standard deviation speed

2020-07-15 Thread 9il via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 11:37:23 UTC, jmh530 wrote: On Wednesday, 15 July 2020 at 11:26:19 UTC, 9il wrote: [snip] @fmamath private double sd(T)(Slice!(T*, 1) flatMatrix) @fastmath violates all summation algorithms except `"fast"`. The same bug is in the original author's post. I

Re: D Mir: standard deviation speed

2020-07-15 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 11:26:19 UTC, 9il wrote: [snip] @fmamath private double sd(T)(Slice!(T*, 1) flatMatrix) @fastmath violates all summation algorithms except `"fast"`. The same bug is in the original author's post. I hadn't realized that @fmamath was the problem, rather than

Re: D Mir: standard deviation speed

2020-07-15 Thread 9il via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 11:23:00 UTC, jmh530 wrote: On Wednesday, 15 July 2020 at 05:57:56 UTC, tastyminerals wrote: [snip] Here is a (WIP) project as of now. Line 160 in https://github.com/tastyminerals/mir_benchmarks_2/blob/master/source/basic_ops.d std of [60, 60] matrix 0.0389492

Re: D Mir: standard deviation speed

2020-07-15 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 05:57:56 UTC, tastyminerals wrote: [snip] Here is a (WIP) project as of now. Line 160 in https://github.com/tastyminerals/mir_benchmarks_2/blob/master/source/basic_ops.d std of [60, 60] matrix 0.0389492 (> 0.001727) std of [300, 300] matrix 1.03592 (> 0.043452)

Re: D Mir: standard deviation speed

2020-07-15 Thread 9il via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 07:34:59 UTC, tastyminerals wrote: On Wednesday, 15 July 2020 at 06:57:21 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:55:51 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:00:46 UTC, tastyminerals wrote: On Wednesday, 15 July 2020 at 02:08:48 UTC, 9il

Re: D Mir: standard deviation speed

2020-07-15 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 06:57:21 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:55:51 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:00:46 UTC, tastyminerals wrote: On Wednesday, 15 July 2020 at 02:08:48 UTC, 9il wrote: On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote:

Re: D Mir: standard deviation speed

2020-07-15 Thread 9il via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 06:00:46 UTC, tastyminerals wrote: On Wednesday, 15 July 2020 at 02:08:48 UTC, 9il wrote: On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: @fastmath private double sd0(T)(Slice!(T*, 1) flatMatrix) @fastmath shouldn't be really used with summation

Re: D Mir: standard deviation speed

2020-07-15 Thread 9il via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 06:55:51 UTC, 9il wrote: On Wednesday, 15 July 2020 at 06:00:46 UTC, tastyminerals wrote: On Wednesday, 15 July 2020 at 02:08:48 UTC, 9il wrote: On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: @fastmath private double sd0(T)(Slice!(T*, 1)

Re: D Mir: standard deviation speed

2020-07-15 Thread tastyminerals via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 02:08:48 UTC, 9il wrote: On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: @fastmath private double sd0(T)(Slice!(T*, 1) flatMatrix) @fastmath shouldn't be really used with summation algorithms except the `"fast"` version of them. Otherwise, they

Re: D Mir: standard deviation speed

2020-07-15 Thread tastyminerals via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 19:36:21 UTC, jmh530 wrote: On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: [...] It would be helpful to provide a link. You should only need one accumulator for mean and centered sum of squares. See the python example under the Welford example

Re: D Mir: standard deviation speed

2020-07-14 Thread 9il via Digitalmars-d-learn
On Wednesday, 15 July 2020 at 02:08:48 UTC, 9il wrote: On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: @fastmath private double sd0(T)(Slice!(T*, 1) flatMatrix) @fastmath shouldn't be really used with summation algorithms except the `"fast"` version of them. Otherwise, they

Re: D Mir: standard deviation speed

2020-07-14 Thread 9il via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: @fastmath private double sd0(T)(Slice!(T*, 1) flatMatrix) @fastmath shouldn't be really used with summation algorithms except the `"fast"` version of them. Otherwise, they may or may not behave like "fast".

Re: D Mir: standard deviation speed

2020-07-14 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 14 July 2020 at 19:04:45 UTC, tastyminerals wrote: I am trying to implement standard deviation calculation in Mir for benchmark purposes. I have two implementations. One is the straightforward std = sqrt(mean(abs(x - x.mean())**2)) and the other follows Welford's algorithm for

D Mir: standard deviation speed

2020-07-14 Thread tastyminerals via Digitalmars-d-learn
I am trying to implement standard deviation calculation in Mir for benchmark purposes. I have two implementations. One is the straightforward std = sqrt(mean(abs(x - x.mean())**2)) and the other follows Welford's algorithm for computing variance (as described here: