Skip to content

Commit 62a1220

Browse files
authored
update installation setup (#269)
update installation setup
2 parents 174c81a + 9e5fe03 commit 62a1220

File tree

12 files changed

+299
-198
lines changed

12 files changed

+299
-198
lines changed

brainpy/__init__.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,38 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = "2.2.3"
3+
__version__ = "2.2.3.1"
44

55

66
try:
77
import jaxlib
88
del jaxlib
99
except ModuleNotFoundError:
1010
raise ModuleNotFoundError(
11-
'Please install jaxlib. See '
12-
'https://brainpy.readthedocs.io/en/latest/quickstart/installation.html#dependency-2-jax '
13-
'for installation instructions.'
14-
) from None
11+
'''
12+
13+
BrainPy needs jaxlib, please install jaxlib.
14+
15+
1. If you are using Windows system, install jaxlib through
16+
17+
>>> pip install jaxlib -f https://whls.blob.core.windows.net/unstable/index.html
18+
19+
2. If you are using macOS platform, install jaxlib through
20+
21+
>>> pip install jaxlib -f https://storage.googleapis.com/jax-releases/jax_releases.html
22+
23+
3. If you are using Linux platform, install jaxlib through
24+
25+
>>> pip install jaxlib -f https://storage.googleapis.com/jax-releases/jax_releases.html
26+
27+
4. If you are using Linux + CUDA platform, install jaxlib through
28+
29+
>>> pip install jaxlib -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
30+
31+
Note that the versions of "jax" and "jaxlib" should be consistent, like "jax=0.3.14", "jaxlib=0.3.14".
32+
33+
More detail installation instruction, please see https://brainpy.readthedocs.io/en/latest/quickstart/installation.html#dependency-2-jax
34+
35+
''') from None
1536

1637

1738
# fundamental modules

brainpy/dyn/layers/conv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import brainpy.math as bm
77
from brainpy.dyn.base import DynamicalSystem
88
from brainpy.initialize import XavierNormal, ZeroInit, parameter
9-
from brainpy.modes import Mode, TrainingMode, NormalMode, training, check
9+
from brainpy.modes import Mode, TrainingMode, training
1010

1111
__all__ = [
1212
'GeneralConv',

brainpy/dyn/layers/normalization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import brainpy.math as bm
1010
from brainpy.initialize import ZeroInit, OneInit, Initializer, parameter
1111
from brainpy.dyn.base import DynamicalSystem
12-
from brainpy.modes import Mode, TrainingMode, NormalMode, training, check
12+
from brainpy.modes import Mode, TrainingMode, NormalMode, training, check_mode
1313

1414
__all__ = [
1515
'BatchNorm',

brainpy/dyn/layers/nvar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import brainpy.math as bm
1010
from brainpy.dyn.base import DynamicalSystem
11-
from brainpy.modes import Mode, NormalMode, BatchingMode, batching, check
11+
from brainpy.modes import Mode, NormalMode, BatchingMode, batching, check_mode
1212
from brainpy.tools.checking import (check_integer, check_sequence)
1313

1414
__all__ = [
@@ -73,7 +73,7 @@ def __init__(
7373
name: str = None,
7474
):
7575
super(NVAR, self).__init__(mode=mode, name=name)
76-
check(self.mode, (BatchingMode, NormalMode), self.__class__.__name__)
76+
check_mode(self.mode, (BatchingMode, NormalMode), self.__class__.__name__)
7777

7878
# parameters
7979
order = tuple() if order is None else order

brainpy/dyn/layers/pooling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import jax.lax
55
import brainpy.math as bm
66
from brainpy.dyn.base import DynamicalSystem
7-
from brainpy.modes import Mode, TrainingMode, NormalMode, training, check
7+
from brainpy.modes import Mode, training
88

99
__all__ = [
1010
'Pool',

brainpy/dyn/neurons/biological_models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from brainpy.integrators.joint_eq import JointEq
99
from brainpy.integrators.ode import odeint
1010
from brainpy.integrators.sde import sdeint
11-
from brainpy.modes import Mode, BatchingMode, TrainingMode, NormalMode, normal, check
11+
from brainpy.modes import Mode, BatchingMode, TrainingMode, NormalMode, normal, check_mode
1212
from brainpy.tools.checking import check_initializer
1313
from brainpy.types import Shape, Array
1414

@@ -219,7 +219,7 @@ def __init__(
219219
keep_size=keep_size,
220220
name=name,
221221
mode=mode)
222-
check(self.mode, (BatchingMode, NormalMode), self.__class__.__name__)
222+
check_mode(self.mode, (BatchingMode, NormalMode), self.__class__.__name__)
223223

224224
# parameters
225225
self.ENa = parameter(ENa, self.varshape, allow_none=False)
@@ -427,7 +427,7 @@ def __init__(
427427
keep_size=keep_size,
428428
name=name,
429429
mode=mode)
430-
check(self.mode, (BatchingMode, NormalMode), self.__class__)
430+
check_mode(self.mode, (BatchingMode, NormalMode), self.__class__)
431431

432432
# params
433433
self.V_Ca = parameter(V_Ca, self.varshape, allow_none=False)
@@ -685,7 +685,7 @@ def __init__(
685685
keep_size=keep_size,
686686
name=name,
687687
mode=mode)
688-
check(self.mode, (NormalMode, BatchingMode), self.__class__)
688+
check_mode(self.mode, (NormalMode, BatchingMode), self.__class__)
689689

690690
# conductance parameters
691691
self.gAHP = parameter(gAHP, self.varshape, allow_none=False)
@@ -994,7 +994,7 @@ def __init__(
994994
):
995995
# initialization
996996
super(WangBuzsakiModel, self).__init__(size=size, keep_size=keep_size, name=name, mode=mode)
997-
check(self.mode, (BatchingMode, NormalMode), self.__class__)
997+
check_mode(self.mode, (BatchingMode, NormalMode), self.__class__)
998998

999999
# parameters
10001000
self.ENa = parameter(ENa, self.varshape, allow_none=False)

brainpy/dyn/neurons/input_groups.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from brainpy.modes import Mode, BatchingMode, normal
1212
from brainpy.types import Shape, Array
1313

14+
1415
__all__ = [
1516
'InputGroup',
1617
'OutputGroup',
@@ -205,3 +206,4 @@ def reset(self, batch_size=None):
205206

206207
def reset_state(self, batch_size=None):
207208
self.spike.value = variable(lambda s: bm.zeros(s, dtype=bool), batch_size, self.varshape)
209+

0 commit comments

Comments
 (0)