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

Features/305 cov #322

Merged
merged 42 commits into from Sep 25, 2019
Merged

Features/305 cov #322

merged 42 commits into from Sep 25, 2019

Conversation

coquelin77
Copy link
Member

@coquelin77 coquelin77 commented Jul 1, 2019

closes #305 by implementing cov in the same style as numpy
closes #375 by implementing dot

@codecov-io
Copy link

codecov-io commented Jul 1, 2019

Codecov Report

Merging #322 into master will increase coverage by 0.07%.
The diff coverage is 97.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #322      +/-   ##
==========================================
+ Coverage   97.27%   97.34%   +0.07%     
==========================================
  Files          53       53              
  Lines       10221    10395     +174     
==========================================
+ Hits         9942    10119     +177     
+ Misses        279      276       -3
Impacted Files Coverage Δ
heat/core/factories.py 100% <ø> (ø) ⬆️
heat/core/dndarray.py 95.24% <0%> (-0.37%) ⬇️
heat/core/tests/test_linalg.py 100% <100%> (ø) ⬆️
heat/core/tests/test_statistics.py 100% <100%> (ø) ⬆️
heat/core/manipulations.py 99.09% <100%> (+0.9%) ⬆️
heat/core/tests/test_manipulations.py 100% <100%> (ø) ⬆️
heat/core/statistics.py 95.91% <97.5%> (+0.14%) ⬆️
heat/core/linalg.py 97.14% <98.18%> (+0.57%) ⬆️
heat/core/logical.py 97.5% <0%> (+2.5%) ⬆️

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 b9f3b70...d4e17d2. Read the comment docs.

@coquelin77 coquelin77 mentioned this pull request Jul 8, 2019
coquelin77 and others added 9 commits July 11, 2019 08:50
edge case for matmul was in the event that the block size in any dimension as 1
this would result in not finding the remainders, a condition in the block setters was added to fix this

the N-D case was removed from dot() because this is not supported by the ht.__mul__ function,
nor was the torch.dot capable of this functionality
@@ -210,8 +210,6 @@ def array(obj, dtype=None, copy=True, ndmin=0, split=None, is_split=None, device
if bool(copy):
if isinstance(obj, torch.Tensor):
obj = obj.clone().detach()
elif isinstance(obj, np.ndarray):
Copy link
Member

Choose a reason for hiding this comment

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

Why is this disallowed here?

heat/core/linalg.py Outdated Show resolved Hide resolved
heat/core/linalg.py Outdated Show resolved Hide resolved
heat/core/linalg.py Show resolved Hide resolved
heat/core/linalg.py Show resolved Hide resolved
heat/core/tests/test_manipulations.py Outdated Show resolved Hide resolved
heat/core/tests/test_statistics.py Outdated Show resolved Hide resolved
actual = ht.array([[1, -1], [-1, 1]], split=0)
self.assertTrue(ht.equal(cov, actual))

f = h5py.File('heat/datasets/data/iris.h5', 'r')
Copy link
Member

Choose a reason for hiding this comment

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

This is a bad idea. h5py is an optional feature, it might not necessarily be installed. We should fall back here to a iris.csv version that we should also have in the datasets.

it might as well be useful for testing purposes to use ht.load_csv instead

Copy link
Member Author

Choose a reason for hiding this comment

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

i found a bug in load_csv. i have made an issue (#368) at the moment this problem does not allow for the the usage of load_csv.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I have assigned Simon already. So we need to wait here for a proper load_csv()


np_cov = np.cov(data, data, rowvar=True)

htdata = ht.load('heat/datasets/data/iris.h5', 'data', split=0)
Copy link
Member

Choose a reason for hiding this comment

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

see h5py thing

heat/core/tests/test_statistics.py Show resolved Hide resolved
@coquelin77 coquelin77 mentioned this pull request Sep 12, 2019
Markus-Goetz
Markus-Goetz previously approved these changes Sep 17, 2019
@Markus-Goetz Markus-Goetz merged commit 2b5d415 into master Sep 25, 2019
@Markus-Goetz Markus-Goetz deleted the features/305-cov branch September 25, 2019 08:45
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.

Introduce dot() call Implement covariance
3 participants