Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

feat(helper): set_embedding function for all frameworks #163

Merged
merged 3 commits into from
Oct 23, 2021

Conversation

hanxiao
Copy link
Member

@hanxiao hanxiao commented Oct 23, 2021

No description provided.

@codecov
Copy link

codecov bot commented Oct 23, 2021

Codecov Report

Merging #163 (8286c5b) into main (fddc57d) will increase coverage by 0.79%.
The diff coverage is 91.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #163      +/-   ##
==========================================
+ Coverage   84.90%   85.70%   +0.79%     
==========================================
  Files          24       25       +1     
  Lines        1166     1189      +23     
==========================================
+ Hits          990     1019      +29     
+ Misses        176      170       -6     
Flag Coverage Δ
finetuner 85.70% <91.30%> (+0.79%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
finetuner/helper.py 94.44% <0.00%> (ø)
finetuner/labeler/__init__.py 0.00% <ø> (ø)
finetuner/tailor/__init__.py 95.23% <ø> (ø)
finetuner/tailor/keras/__init__.py 86.00% <ø> (ø)
finetuner/tailor/paddle/__init__.py 96.33% <ø> (ø)
finetuner/tailor/pytorch/__init__.py 97.19% <ø> (ø)
finetuner/tuner/__init__.py 81.81% <ø> (ø)
finetuner/tuner/keras/losses.py 100.00% <ø> (ø)
finetuner/tuner/paddle/losses.py 100.00% <ø> (ø)
finetuner/tuner/pytorch/losses.py 100.00% <ø> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 870c5a2...8286c5b. Read the comment docs.

@hanxiao hanxiao changed the title feat(helper): add embedding function for all frameworks feat(helper): set_embedding function for all frameworks Oct 23, 2021
Comment on lines +40 to +51
def test_embedding_docs(framework, tmpdir):
# works for DA
embed_model = embed_models[framework]()
docs = DocumentArray(generate_fashion_match(num_total=100))
set_embeddings(docs, embed_model)
assert docs.embeddings.shape == (100, 32)

# works for DAM
dam = DocumentArrayMemmap(tmpdir)
dam.extend(generate_fashion_match(num_total=42))
set_embeddings(dam, embed_model)
assert dam.embeddings.shape == (42, 32)
Copy link
Member Author

Choose a reason for hiding this comment

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

@bwanglzu could you add some pytest mark to allow gpu test on this as well?

Copy link
Member

Choose a reason for hiding this comment

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

okay

@hanxiao hanxiao marked this pull request as ready for review October 23, 2021 10:55
@hanxiao hanxiao merged commit 43480cc into main Oct 23, 2021
@hanxiao hanxiao deleted the feat-embedding-method branch October 23, 2021 12:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants