提交 3a103923 authored 作者: Jonathan J Hunt's avatar Jonathan J Hunt

Minor fix to make pickle example more accurate.

上级 0877fabf
...@@ -131,7 +131,7 @@ matrix *W* and a bias *b*, you can define: ...@@ -131,7 +131,7 @@ matrix *W* and a bias *b*, you can define:
.. code-block:: python .. code-block:: python
def __getstate__(self): def __getstate__(self):
return (W, b) return (self.W, self.b)
def __setstate__(self, state): def __setstate__(self, state):
W, b = state W, b = state
...@@ -145,7 +145,7 @@ functions to reflect the change in name: ...@@ -145,7 +145,7 @@ functions to reflect the change in name:
.. code-block:: python .. code-block:: python
def __getstate__(self): def __getstate__(self):
return (weights, bias) return (self.weights, self.bias)
def __setstate__(self, state): def __setstate__(self, state):
W, b = state W, b = state
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论