[
https://issues.apache.org/jira/browse/MAHOUT-900?focusedWorklogId=1002890&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1002890
]
ASF GitHub Bot logged work on MAHOUT-900:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Feb/26 16:26
Start Date: 01/Feb/26 16:26
Worklog Time Spent: 10m
Work Description: ryankert01 commented on PR #938:
URL: https://github.com/apache/mahout/pull/938#issuecomment-3831333110
Comparison of Naive O(4^n) vs Fast Walsh-Hadamard Transform O(nĂ—2^n)
implementations.
## Single Sample Performance
| Qubits | Naive | FWT | Speedup |
|--------|-------|-----|---------|
| 4 | 0.150 ms | 0.150 ms | 1.0x |
| 6 | 0.237 ms | 0.143 ms | 1.7x |
| 8 | 1.199 ms | 0.143 ms | 8.4x |
| 10 | 6.213 ms | 0.117 ms | **53x** |
## Batch Performance (64 samples)
| Qubits | Naive | FWT | Speedup |
|--------|-------|-----|---------|
| 4 | 0.139 ms | 0.149 ms | 0.9x |
| 6 | 0.316 ms | 0.155 ms | 2.0x |
| 8 | 1.223 ms | 0.139 ms | 8.8x |
| 10 | 22.23 ms | 0.165 ms | **135x** |
Issue Time Tracking
-------------------
Worklog Id: (was: 1002890)
Time Spent: 1h 50m (was: 1h 40m)
> RandomSeedGenerator samples / output k texts incorrectly
> --------------------------------------------------------
>
> Key: MAHOUT-900
> URL: https://issues.apache.org/jira/browse/MAHOUT-900
> Project: Mahout
> Issue Type: Bug
> Components: classic
> Affects Versions: 0.5
> Reporter: Sean R. Owen
> Assignee: Sean R. Owen
> Priority: Minor
> Fix For: 0.6
>
> Attachments: MAHOUT-900.patch
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> {code}
> int currentSize = chosenTexts.size();
> if (currentSize < k) {
> chosenTexts.add(newText);
> chosenClusters.add(newCluster);
> } else if (random.nextInt(currentSize + 1) == 0) { // with chance
> 1/(currentSize+1) pick new element
> int indexToRemove = random.nextInt(currentSize); // evict one
> chosen randomly
> chosenTexts.remove(indexToRemove);
> chosenClusters.remove(indexToRemove);
> chosenTexts.add(newText);
> chosenClusters.add(newCluster);
> }
> {code}
> The second "if" condition ought to be "!= 0", right? Only if it is 0 do we
> skip the body, which removes an existing element, since the new element
> itself is evicted.
> Second, this code:
> {code}
> for (int i = 0; i < k; i++) {
> writer.append(chosenTexts.get(i), chosenClusters.get(i));
> }
> {code}
> ... assumes that at least k elements existed in the input, and fails
> otherwise. Probably need to cap this.
> Patch attached.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)