Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #17

Merged
merged 2 commits into from
Dec 22, 2020
Merged

Cleanup #17

merged 2 commits into from
Dec 22, 2020

Conversation

piobab
Copy link
Contributor

@piobab piobab commented Dec 21, 2020

Sparse Matrix refactor (cleanup, simplification, using iter, speedup). Use Cargo.toml data for clap crate.

@piobab piobab requested a review from kodieg December 21, 2020 16:54
for (j, hsh) in self.sparse_matrix_reader.iter_hashes().enumerate() {
let col_value = ((hash((hsh.value as i64) + (i as i64)) % max_hash) as f32)
/ max_hash_float;
col.insert(j as usize, col_value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use col.push(col_value) here?

Copy link
Collaborator

@kodieg kodieg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -41,7 +42,7 @@ fn test_build_graphs_and_create_embeddings() {
// calculate embeddings in memory
calculate_embeddings(
config.clone(),
sparse_matrix,
sparse_matrix.clone(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe Arc::clone(&sparse_matrix) to indicate that this is cheap (though, maybe not)

@piobab piobab merged commit 5b70a6c into master Dec 22, 2020
@piobab piobab deleted the cleanup branch December 22, 2020 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants