Giter Club home page Giter Club logo

gelib's People

Contributors

agoscinski avatar ehthiede avatar risi-kondor avatar rwkeane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gelib's Issues

gelib_base star import overwrites python wrapper classes

Hello,

the from gelib_base import * import in the init.py is overwriting all Python wrapper classes. So for example when I use gelib.SO3vec it is from the shared lib gelib_base and not gelib

In [1]: import gelib
Initializing GElib without GPU support.

In [2]: gelib.SO3vec
Out[2]: gelib_base.SO3vec
In [3]: gelib.SO3vec.randn
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[10], line 1
----> 1 gelib.SO3vec.randn

AttributeError: type object 'gelib_base.SO3vec' has no attribute 'randn'

I commented out the gelib_base import in this PR and it then it works

In [1]: import gelib
Initializing GElib without GPU support.

In [2]: gelib.SO3vec.randn
Out[2]: <bound method SO3vec.randn of <class 'gelib.SO3vec.SO3vec'>>

Failing tests in ci_tests/test_SO3vecArr.py and manual_tests/test_FFT_accuracies.py

In PR #5 I commented out these tests, because they are failing.

# @pytest.mark.parametrize('b', [1, 2, 4])
# @pytest.mark.parametrize('a', [1, 2, 4])
# @pytest.mark.parametrize('maxl', range(7))
# def test_Fproduct_backprop(self,b,a,maxl):
# return

# @pytest.mark.parametrize('b', [1, 2, 4])
# @pytest.mark.parametrize('a', [1, 2, 4])
# @pytest.mark.parametrize('maxl', range(7))
# def test_Fproduct(self,b,a,maxl):
# x=G.SO3vecArr.Frandn(b,[a],maxl)
# y=G.SO3vecArr.Frandn(b,[a],maxl)
# R = G.SO3element.uniform()
# xr=x.rotate(R)
# yr=y.rotate(R)
#
# z=G.Fproduct(x,y,maxl=maxl)
# zr=G.Fproduct(xr,yr,maxl=maxl)
# rz=z.rotate(R)
#
# for i in range(maxl+1 ):
# assert (torch.allclose(rz.parts[i] , zr.parts[i], rtol=1e-3, atol=1e-2))

## TESTS FAILS, ERROR MESSAGE:
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/runner.py:341: in from_call
# result: Optional[TResult] = func()
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/runner.py:372: in <lambda>
# call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/python.py:531: in collect
# self._inject_setup_module_fixture()
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/python.py:545: in _inject_setup_module_fixture
# self.obj, ("setUpModule", "setup_module")
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/python.py:310: in obj
# self._obj = obj = self._getobj()
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/python.py:528: in _getobj
# return self._importtestmodule()
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/python.py:617: in _importtestmodule
# mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/pathlib.py:565: in import_path
# importlib.import_module(module_name)
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/importlib/__init__.py:126: in import_module
# return _bootstrap._gcd_import(name[level:], package, level)
# <frozen importlib._bootstrap>:1050: in _gcd_import
# ???
# <frozen importlib._bootstrap>:1027: in _find_and_load
# ???
# <frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
# ???
# <frozen importlib._bootstrap>:688: in _load_unlocked
# ???
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:178: in exec_module
# exec(co, module.__dict__)
# python/tests/manual_tests/test_FFT_accuracies.py:12: in <module>
# inverse = gelib.SO3iFFT(signals, bandwidth)
# python/src/gelib/SO3vec.py:600: in SO3iFFT
# return v.iFFT(N)
# python/src/gelib/SO3vec.py:246: in iFFT
# return SO3vec_iFFTFn.apply(_N,*(self.parts))
# /opt/anaconda3/envs/gelib-test-ci/lib/python3.10/site-packages/torch/autograd/function.py:506: in apply
# return super().apply(*args, **kwargs) # type: ignore[misc]
# python/src/gelib/SO3vec.py:467: in forward
# _r=ctensorb.view(r)
# E RuntimeError: expected scalar type ComplexFloat
#for bandwidth in range(1, 101):
# inverse = gelib.SO3iFFT(signals, bandwidth)
# signals_ = gelib.SO3FFT(inverse, maxl)
# sum_errors = 0
# total_elems = 0
# for l in range(len(signals.parts)):
# error = torch.sum(torch.abs(torch.tensor(signals.parts[l]) - torch.tensor(signals_.parts[l])))
# print(torch.tensor(error))
# total_elems += signals.parts[l].numel()
# average_error = sum_errors / total_elems
# print(bandwidth, sum_errors, average_error)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.