提交 58868b92 authored 作者: abergeron's avatar abergeron

Merge pull request #1924 from delallea/minor

Typos
......@@ -3,8 +3,8 @@
Easy Installation of an optimized Theano on Ubuntu
==================================================
These instruction was done for Ubuntu 11.04, 11.10, 12.04, 12.10, 13.04
and 13.10. You can probably do something similar on older computer.
These instructions were written for Ubuntu 11.04, 11.10, 12.04, 12.10, 13.04
and 13.10. You can probably do something similar on older versions.
.. note::
......
......@@ -124,7 +124,7 @@ List of Implemented Operations
- :func:`csr_from_dense <theano.sparse.basic.csr_from_dense>`,
:func:`csc_from_dense <theano.sparse.basic.csc_from_dense>`.
The grad implemented is structured.
- Theano SparseVariable object have a method ``toarray()`` that is the same as
- Theano SparseVariable objects have a method ``toarray()`` that is the same as
:func:`dense_from_sparse <theano.sparse.basic.dense_from_sparse>`.
- Construction of Sparses and their Properties
......
......@@ -1346,7 +1346,7 @@ Mathematical
sometimes more accurate).
C code is provided in the Theano_lgpl repository.
This make it faster.
This makes it faster.
https://github.com/Theano/Theano_lgpl.git
......
......@@ -22,7 +22,7 @@ the same Theano type. Here is an example::
A second example with Scan. Scan doesn't yet have direct support of
TypedList, so you can only use it as non_sequences (not in sequences or
as outputs).::
as outputs)::
import theano.typed_list
......
......@@ -16,9 +16,9 @@ import numpy
def register_view_op_c_code(type, code, version=()):
""" Tell ViewOp how to generate C code for a Theano Type
:param typ: A Theano type. It must be the Theano class itself and not an
:param type: A Theano type. It must be the Theano class itself and not an
instance of the class.
:param code: C code that return a view for the Theano type 'typ'.
:param code: C code that returns a view for the Theano type 'type'.
Use %(iname)s and %(oname)s for the input and output C
variable names respectively.
:param version: A number indicating the version of the code, for cache.
......@@ -396,7 +396,7 @@ def register_shape_i_c_code(typ, code, version=()):
:param typ: A Theano type. It must be the Theano class itself and not an
instance of the class.
:param code: C code that get the shape of dimensions %(i)s for the Theano type 'typ'.
:param code: C code that gets the shape of dimensions %(i)s for the Theano type 'typ'.
Use %(iname)s and %(oname)s for the input and output C
variable names respectively.
:param version: A number indicating the version of the code, for cache.
......@@ -508,11 +508,11 @@ def register_rebroadcast_c_code(typ, code, version=()):
:param typ: A Theano type. It must be the Theano class itself and not an
instance of the class.
:param code: C code that check if the dimensions %(axis) is of
:param code: C code that checks if the dimension %(axis)s is of
shape 1 for the Theano type 'typ'. Use %(iname)s and
%(oname)s for the input and output C variable names
respectively. %(axis)s for the axis that we need to
check. This code is put in a loop for all axis
respectively, and %(axis)s for the axis that we need to
check. This code is put in a loop for all axes.
:param version: A number indicating the version of the code, for cache.
"""
......@@ -546,14 +546,13 @@ class Rebroadcast(gof.Op):
self.axis = dict(axis)
for axis, broad in self.axis.iteritems():
assert isinstance(axis, (numpy.integer, int)), (
"Rebroadcast need integers axis. Got ", axis)
"Rebroadcast needs integer axes. Got ", axis)
def __eq__(self, other):
return type(self) == type(other) and self.axis == other.axis
def __hash__(self):
items = self.axis.items()
items.sort() # no ambiguity because each item key is unique
items = sorted(self.axis.iteritems()) # no ambiguity because each item key is unique
return hash(type(self)) ^ hash(tuple(items))
def __str__(self):
......@@ -654,7 +653,7 @@ def register_specify_shape_c_code(typ, code, version=(),
:param typ: A Theano type. It must be the Theano class itself and not an
instance of the class.
:param code: C code that check the shape and return a view for the Theano type 'typ'.
:param code: C code that checks the shape and returns a view for the Theano type 'typ'.
Use %(iname)s and %(oname)s for the input and output C
variable names respectively.
%(shape)s is the vector of shape of %(iname)s.
......
......@@ -693,7 +693,7 @@ CSC = CSM('csc')
representation.
:param data: One dimensional tensor representing
the data of the sparse to construct.
the data of the sparse matrix to construct.
:param indices: One dimensional tensor of integers
representing the indices of the sparse
matrix to construct.
......@@ -716,7 +716,7 @@ CSR = CSM('csr')
representation.
:param data: One dimensional tensor representing
the data of the sparse to construct.
the data of the sparse matrix to construct.
:param indices: One dimensional tensor of integers
representing the indices of the sparse
matrix to construct.
......@@ -1096,18 +1096,18 @@ class GetItem2d(gof.op.Op):
return self.__class__.__name__
get_item_2d = GetItem2d()
"""Implement a subtensor of sparse variable and that return a
"""Implement a subtensor of sparse variable, returning a
sparse matrix.
If you want to take only one element of a sparse matrix see
`GetItemScalar` that return a tensor scalar.
`GetItemScalar` that returns a tensor scalar.
.. note::
Subtensor selection always returns a matrix, so indexing
with [a:b, c:d] is forced. If one index is a scalar. For
instance, x[a:b, c] and x[a, b:c], generate an error. Use
instead x[a:b, c:c+1] and x[a:a+1, b:c].
with [a:b, c:d] is forced. If one index is a scalar, for
instance, x[a:b, c] or x[a, b:c], an error will be raised. Use
instead x[a:b, c:c+1] or x[a:a+1, b:c].
The above indexing methods are not supported because the return value
would be a sparse matrix rather than a sparse vector, which is a
......@@ -1118,7 +1118,7 @@ when sparse vectors are supported.
:param x: Sparse matrix.
:param index: Tuple of slice object.
:return: The slice corresponding in `x`.
:return: The corresponding slice in `x`.
:note: The grad is not implemented for this op.
"""
......@@ -1168,8 +1168,8 @@ class GetItemScalar(gof.op.Op):
return self.__class__.__name__
get_item_scalar = GetItemScalar()
"""Implement a subtensor of a sparse variable that take
two scalars as index and return a scalar.
"""Implement a subtensor of a sparse variable that takes
two scalars as index and returns a scalar.
If you want to take a slice of a sparse matrix see
`GetItem2d` that returns a sparse matrix.
......@@ -1177,7 +1177,7 @@ If you want to take a slice of a sparse matrix see
:param x: Sparse matrix.
:param index: Tuple of scalars.
:return: The item corresponding in `x`.
:return: The corresponding item in `x`.
:note: The grad is not implemented for this op.
"""
......@@ -1498,14 +1498,14 @@ class SpSum(gof.op.Op):
def sp_sum(x, axis=None, sparse_grad=False):
"""Calculate the sum of a sparse matrix along a specify
"""Calculate the sum of a sparse matrix along the specified
axis.
It operates a reduction along the axis specified. When
`axis` is `None`, it is apply along all axes.
It operates a reduction along the specified axis. When
`axis` is `None`, it is applied along all axes.
:param x: Sparse matrix.
:param axis: Axis along which the sum is applied. Integers or `None`.
:param axis: Axis along which the sum is applied. Integer or `None`.
:param sparse_grad: `True` to have a structured grad. Boolean.
:return: The sum of `x` in a dense format.
......@@ -1645,7 +1645,7 @@ class EnsureSortedIndices(gof.op.Op):
else:
return self.__class__.__name__ + "{no_inplace}"
ensure_sorted_indices = EnsureSortedIndices(inplace=False)
"""Resort indices of a sparse matrix.
"""Re-sort indices of a sparse matrix.
CSR column indices are not necessarily sorted. Likewise
for CSC row indices. Use `ensure_sorted_indices` when sorted
......@@ -1662,12 +1662,12 @@ libraries).
def clean(x):
"""Remove explicit zeros from a sparse matrix, and
resort indices.
re-sort indices.
CSR column indices are not necessarily sorted. Likewise
for CSC row indices. Use `clean` when sorted
indices are required (e.g. when passing data to other
libraries) and to ensure there is no zeros in the data.
libraries) and to ensure there are no zeros in the data.
:param x: A sparse matrix.
......@@ -1860,9 +1860,9 @@ class StructuredAddSV(gof.op.Op):
return self.__class__.__name__
structured_add_s_v = StructuredAddSV()
"""Structured addition of a sparse matrix and a dense vector.
The elements of the vector are are only added to the corresponding
non-zero elements. Therefore, this operation outputs another sparse
matrix.
The elements of the vector are only added to the corresponding
non-zero elements of the sparse matrix. Therefore, this operation
outputs another sparse matrix.
:param x: Sparse matrix.
:param y: Tensor type vector.
......@@ -3696,7 +3696,7 @@ class Usmm(gof.op.Op):
out[0] = rval
usmm = Usmm()
"""Performs the expression is `alpha` * `x` `y` + `z`.
"""Performs the expression `alpha` * `x` `y` + `z`.
:param x: Matrix variable.
:param y: Matrix variable.
......
......@@ -3151,7 +3151,7 @@ class Split(Op):
raise ValueError('The splits sum to %s, expected %s' %
(numpy.sum(splits), len_along_axis))
if python_any([nb < 0 for nb in splits]):
raise ValueError('Split: you try to make an ndarray with'
raise ValueError('Split: you tried to make an ndarray with a '
'negative number of elements.')
# Checking is done, let's roll the splitting algorithm!
......
......@@ -88,7 +88,7 @@ def conv2d(input, filters, image_shape=None, filter_shape=None,
if input.ndim == 2 and filters.ndim == 2:
if theano.config.warn.signal_conv2d_interface:
warnings.warn(
"theano.tensor.signal.conv2d() now output 2d tensor when both"
"theano.tensor.signal.conv2d() now outputs a 2d tensor when both"
" inputs are 2d. To disable this warning, set the Theano flag"
" warn.signal_conv2d_interface to False",
stacklevel=3)
......
......@@ -101,7 +101,7 @@ getitem = GetItem()
"""
Get specified slice of a typed list.
:param x: type type list.
:param x: typed list.
:param index: the index of the value to return from `x`.
"""
......@@ -227,7 +227,7 @@ class Extend(Op):
extend = Extend()
"""
Append all element of a list at the end of another list.
Append all elements of a list at the end of another list.
:param x: The typed list to extend.
:param toAppend: The typed list that will be added at the end of `x`.
......@@ -296,7 +296,7 @@ insert = Insert()
"""
Insert an element at an index in a typed list.
:param x: the typed list to modified.
:param x: the typed list to modify.
:param index: the index where to put the new element in `x`.
:param toInsert: The new element to insert.
"""
......@@ -475,11 +475,11 @@ class Count(Op):
count = Count()
"""
Count the number of time an element is in the typed list.
Count the number of times an element is in the typed list.
:param x: The typed list to look into.
:param elem: The element we want to count in list.
The element are compared with equals.
The elements are compared with equals.
:note: Python implementation of count doesn't work when we want to
count an ndarray from a list. This implementation works in that
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论