fix __name__ being incorrect due to extra __all__
this fixes tracebacks and checks for __main__, among other things.
This commit is contained in:
parent
ec71d4956e
commit
7161f983ab
14 changed files with 12 additions and 16 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,4 +4,3 @@ __pycache__
|
|||
# work in progress:
|
||||
onn/component.py
|
||||
onn/extra.py
|
||||
onn/run.py
|
||||
|
|
|
@ -3,7 +3,7 @@ import numpy as np
|
|||
# just for speed, not strictly essential:
|
||||
from scipy.special import expit as sigmoid
|
||||
|
||||
from .float import *
|
||||
from .float import _f, _1
|
||||
from .layer_base import *
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f, _0, _1
|
||||
from .layer import Layer
|
||||
from .loss import Loss
|
||||
from .optimizer import Optimizer
|
||||
|
|
|
@ -16,6 +16,3 @@ _inv2 = _f(1/2)
|
|||
_sqrt2 = _f(np.sqrt(2))
|
||||
_invsqrt2 = _f(1/np.sqrt(2))
|
||||
_pi = _f(np.pi)
|
||||
|
||||
__all__ = [k for k, v in locals().items()
|
||||
if not __import__('inspect').ismodule(v)]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from .layer_base import *
|
||||
from .initialization import *
|
||||
from .float import *
|
||||
from .float import _f, _1
|
||||
|
||||
|
||||
# Nonparametric Layers {{{1
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from .float import *
|
||||
from .float import _f, _1, _pi, _inv2
|
||||
from .optimizer_base import *
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f
|
||||
|
||||
|
||||
class Loss:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import sys
|
||||
|
||||
from .float import *
|
||||
from .float import _f, _0
|
||||
from .nodal import *
|
||||
from .layer_base import *
|
||||
from .utility import *
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f, _0, _1
|
||||
from .optimizer_base import *
|
||||
from .utility import *
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f
|
||||
|
||||
|
||||
class Optimizer:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f
|
||||
from .layer_base import *
|
||||
from .initialization import *
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import _f, _0
|
||||
from .layer import Layer
|
||||
from .float import *
|
||||
|
||||
|
||||
class Regularizer:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f
|
||||
from .initialization import *
|
||||
from .ritual_base import *
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import types
|
||||
import numpy as np
|
||||
|
||||
from .float import *
|
||||
from .float import _f, _0
|
||||
|
||||
|
||||
class Ritual: # i'm just making up names at this point.
|
||||
|
|
Loading…
Reference in a new issue