Nic Duquette :python: on Nostr: Wow. I think vectorizing my janky loops reduced computing time by an order of ...
Wow. I think vectorizing my janky loops reduced computing time by an order of magnitude... but moving my vectorized code from numpy to scipy's sparse matrix operations cut things down by **TWO** orders of magnitude. Stuff is happening within acceptable time spans now.
(Obviously this pro tip only works if your matrices are sparse)
Published at
2024-03-06 03:05:34Event JSON
{
"id": "f77eb8dd8a4f590695b2fd67360ed259f6769cf1b8a5ba9bfe1ef2996bbc70dd",
"pubkey": "0ec94a637f5f232a9ed5ae60a397fe0a3a620dcd86d12e6624fbf05d4970c43d",
"created_at": 1709694334,
"kind": 1,
"tags": [
[
"proxy",
"https://sciences.social/users/nic/statuses/112046527896219664",
"activitypub"
]
],
"content": "Wow. I think vectorizing my janky loops reduced computing time by an order of magnitude... but moving my vectorized code from numpy to scipy's sparse matrix operations cut things down by **TWO** orders of magnitude. Stuff is happening within acceptable time spans now.\n\n(Obviously this pro tip only works if your matrices are sparse)",
"sig": "818f8b4911a27350bc69bb2a3f0e7d2df2865de529d5580dbf02f8c01e2d25e0406b4bb1d4a2341ee1882626dc76b1c9622ce65d6d8fb5aa387b0a9cdb52e233"
}