From cd69f0b10bbb045249d7adb19050f844dc7deb92 Mon Sep 17 00:00:00 2001 From: Jonas Loos <33965649+JonasLoos@users.noreply.github.com> Date: Thu, 19 Sep 2024 22:59:42 +0200 Subject: [PATCH] cosine similarity bug fix --- worker/pkg/worker.js | 11 ++++------- worker/pkg/worker_bg.wasm | Bin 66749 -> 66703 bytes worker/src/lib.rs | 8 ++++---- worker/webworker.js | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/worker/pkg/worker.js b/worker/pkg/worker.js index c03bed2..36d6997 100644 --- a/worker/pkg/worker.js +++ b/worker/pkg/worker.js @@ -277,7 +277,7 @@ function handleError(f, args) { wasm.__wbindgen_exn_store(addHeapObject(e)); } } -function __wbg_adapter_55(arg0, arg1, arg2, arg3) { +function __wbg_adapter_53(arg0, arg1, arg2, arg3) { wasm.wasm_bindgen__convert__closures__invoke2_mut__h493f10fe887c5e99(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } @@ -375,9 +375,6 @@ function __wbg_get_imports() { const ret = getObject(arg0).arrayBuffer(); return addHeapObject(ret); }, arguments) }; - imports.wbg.__wbg_log_79d3c56888567995 = function(arg0) { - console.log(getObject(arg0)); - }; imports.wbg.__wbg_newwithstrandinit_11fbc38beb4c26b0 = function() { return handleError(function (arg0, arg1, arg2) { const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); return addHeapObject(ret); @@ -450,7 +447,7 @@ function __wbg_get_imports() { const a = state0.a; state0.a = 0; try { - return __wbg_adapter_55(a, state0.b, arg0, arg1); + return __wbg_adapter_53(a, state0.b, arg0, arg1); } finally { state0.a = a; } @@ -506,8 +503,8 @@ function __wbg_get_imports() { const ret = wasm.memory; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper266 = function(arg0, arg1, arg2) { - const ret = makeMutClosure(arg0, arg1, 45, __wbg_adapter_20); + imports.wbg.__wbindgen_closure_wrapper236 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 44, __wbg_adapter_20); return addHeapObject(ret); }; diff --git a/worker/pkg/worker_bg.wasm b/worker/pkg/worker_bg.wasm index 78ce693bf99ef1dcf1b7c58b4a65dd8f13322652..a5fb6aa962cf284f5b927a89126b8b3ea2b5876b 100644 GIT binary patch delta 19782 zcmbV!34B%6wf@=Xj=AUFn{zWykbO=<=8ym}VU+AB^H`j4L}U#h3~H*VY2_(xsiIO#6%||i9W$DBAPFm8@&5{;sQdM6Kp>ZDNwSnJ4VhJTA9i*OPU><~RKT zrn}v`pD|sR5ELbvc#iDChXp18A=6(OFYnCm%deO3ZOXoK= zEnlFmO6ixkVv&=1qvXDg>|Xhd&#u_clKYidykgNJZ8J;jm$hj1vUw|8makZ(JuF@R zhS;4f=}D$*f*GaVY;iaH;Uy2S$5=O;Gw1T+aoy}W^?z(PyZSD+71>+aL+n;IrJF5T z$JVpu^*fOFIG$_nRxdSCZj8K_wX%EIRhJFBkF7rE`wcf;yzI)`*hOvZHg*eZXLqtT z{J(>(VYjmf*oXz|*|nmR{a96R{s~*lCSTFbI?(uv-E1dvpJI=)jiBQF>=C3oSm3n$ zo4=mzmZOtqu#Iv}(*3Mc76ir`+n(;xqPClBqEj{n3y^zHU|h-Gy**lquFVL!^m@IX zvkC5cvD?YBwFx0F*OmyqMQoIx2M(jT1IAfidM$QKSMZ86wAmgUcXqr@+vTq3F0r~< zsIDz0_Bjn(x*ijq@lHH~p^$4;i|uNr&O4R?yUvk_sa7^tH&pr^iBvd?(J(+ z>ur;LqfM`B(;IIy5WdW5)9tj`93F$&>j?(%7MR zjwYxmn~_V?r%cXJ$q*BbO+YXA;%VqxhQWV#i*p%jhLb_CAulmi62T(*!!l3 z5_{us_C7tbU%3PHYG3>ng}vntQDT4m4TWN#ToPIC{gk2~%R`a0)GsJXY3i}H3yCje zBqhySL(x<5{I>pyc1pB$$x$iGyxkPQnsJInBl<1bvr&Y3p@_5<^FHu??l2&>yR)1Xj zX#B2DAC~p)W)#bG%b%rF&Ck-y>xuHEx@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D4&6!m|C!G!J?+Cnyz2Gh+ox!Uz3`DGgrSqwO~H<>O#M% z^+YH0kW#11~mt6wHmbpQJd&{De?@LGc`?Xm-n2QWgbPVDX6{NuW4yW<;fFsaggiM{~76R zNins-vhj3p`K$k#T#^wqwMl5O5m$d)^syrSEkV6lv$0JJeLr9R?5pcNc(z7<`nQRN zfsnJP@u;c7l_<|e{v!GIpJ&NEUuPl=^!nHN>6xfowsc;fhU>5Hy>ywT9Sh0ozx7PZ zqStUyr`>R6%iSll<*Bcm*i6}Yascj6o~-CMGi++}@N^TF=S7->EAbYgh+vZ_cSpWR zvcIol*U3Bo{%l%9s)-X)nsyUXg5@MR`kTd78&G-@*NeD*f$L3N@8jZV5ynOHv2fYA zish%@42zT?M}Gw29`gPZ!{q#bWCD;k|D&jiFq{~_6!|h-3l}t9w|M@-#q$?vMB>Tk zz2qazjta`S|8NYNOXbnw0<(}pY<1Ck!EVwp+vpVn~8D{82k3c>T7a=Rr z%K+qwCOX#*Lb+PL{m;9t!Re-U4N5JzqPP;}HOSMv2g{qkU6lrI)If^b5L|HdKu3|& zvr@KZm}(7A%Y~;0WD&{}aGHSpL|l{P^QQ--gfdNyu*&6MPZzPejcM!xcHPE{S#f+D zo)qB8-MCV4CCaOT7Q$NRJ}0A0R2#rWYnysTc^b;oam~PG;-WS)ab1M#VqEk`n7Rbl zxT}_3$D6L&_%+L7gEvJO8^EsEBpA!inuVu{Rm?{IQe2m9T8I`Yhq6q?E_*jU&DaHz z%khN%sLv}l{hhIVcHyQhoeg7mZkn#M;=(Q6Ooa>rSOfC(w;w6Juz%A7I?Ik+tty>9 l=52ajXElXdwnK6pX*wQ5VkF repr2 .axis_iter(Axis(0)) .enumerate() - .map(|(index, b)| b.dot(&a) / (norms1[[index]] * norms2[[index]])) + .map(|(index, b)| b.dot(&a) / (norms1[[row*n+col]] * norms2[[index]])) .collect::>(), "cosine_centered" => repr2 .axis_iter(Axis(0)) @@ -71,7 +72,7 @@ pub fn calc_similarities( Zip::from(a) .and(b) .and(means.as_ref().unwrap().view()) - .fold(0.0, |acc, &ai, &bi, &mean| acc + (ai - mean) * (bi - mean)) / (norms1[[index]] * norms2[[index]])) + .fold(0.0, |acc, &ai, &bi, &mean| acc + (ai - mean) * (bi - mean)) / (norms1[[row*n+col]] * norms2[[index]])) .collect::>(), "manhattan" => repr2 .axis_iter(Axis(0)) @@ -117,7 +118,6 @@ pub async fn fetch_repr(url: String, n: usize, m: usize) -> Result<(), JsValue> // if the representation is already fetched, return if GLOBAL_MAP.with(|map| map.borrow().contains_key(&url)) { - console::log_1(&JsValue::from_str(&format!("WASM: Representation already fetched: {}", url))); return Ok(()); } diff --git a/worker/webworker.js b/worker/webworker.js index 425fdbd..a16195e 100644 --- a/worker/webworker.js +++ b/worker/webworker.js @@ -1,9 +1,9 @@ import * as wasm from './pkg/worker.js'; -const asdf = wasm.default().then(_ => null); +const wasmInit = wasm.default().then(_ => null); onmessage = function(e) { - asdf.then(_ => { + wasmInit.then(_ => { const id = e.data.id; if (e.data.task === 'fetch_repr') { const { url, n, m } = e.data.data;