Skip to content

Commit

Permalink
version 0.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurii Shevchuk committed Apr 4, 2019
1 parent 0aa7078 commit d379e5b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>


NeuPy v0.8.1
NeuPy v0.8.2
============

NeuPy is a python library for prototyping and building neural networks. NeuPy uses Tensorflow as a computational backend for deep learning models.
Expand Down
2 changes: 1 addition & 1 deletion examples/cnn/mnist_cnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def load_data():
# It's suitable for classification with 3 and more classes.
loss='categorical_crossentropy',

# Mini-batch size. It defined how many samples will be propagated
# Mini-batch size. It defines how many samples will be propagated
# through the network at once. During the training, weights will
# be updated after every mini-batch propagation.
# Note: When number of training samples is not divisible by 128
Expand Down
2 changes: 1 addition & 1 deletion neupy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
NeuPy is a Python library for Artificial Neural Networks and Deep Learning.
"""

__version__ = '0.8.1'
__version__ = '0.8.2'
35 changes: 18 additions & 17 deletions neupy/algorithms/gd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,25 @@ def init_functions(self):

tf_utils.initialize_uninitialized_variables()

self.functions.update(
predict=tf_utils.function(
inputs=as_tuple(self.network.inputs),
outputs=self.network.outputs,
name='optimizer/predict'
),
one_training_update=tf_utils.function(
inputs=as_tuple(self.network.inputs, self.target),
outputs=loss,
updates=training_updates,
name='optimizer/one-update-step'
),
score=tf_utils.function(
inputs=as_tuple(self.network.inputs, self.target),
outputs=val_loss,
name='optimizer/score'
with tf.name_scope('optimizer'):
self.functions.update(
predict=tf_utils.function(
inputs=as_tuple(self.network.inputs),
outputs=self.network.outputs,
name='predict'
),
one_training_update=tf_utils.function(
inputs=as_tuple(self.network.inputs, self.target),
outputs=loss,
updates=training_updates,
name='one-update-step'
),
score=tf_utils.function(
inputs=as_tuple(self.network.inputs, self.target),
outputs=val_loss,
name='score'
),
)
)

def format_input(self, X):
X = as_tuple(X)
Expand Down
7 changes: 5 additions & 2 deletions neupy/algorithms/gd/objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
from neupy.utils import asfloat, function_name_scope


__all__ = ('mse', 'rmse', 'mae', 'msle', 'rmsle', 'binary_crossentropy',
'categorical_crossentropy', 'binary_hinge', 'categorical_hinge')
__all__ = (
'mse', 'rmse', 'mae', 'msle', 'rmsle',
'binary_crossentropy', 'categorical_crossentropy',
'binary_hinge', 'categorical_hinge',
)


smallest_positive_number = 1e-7 # for 32-bit float numbers
Expand Down
3 changes: 2 additions & 1 deletion neupy/algorithms/gd/rprop.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ class IRPROPPlus(RPROP):
>>> x_train = np.array([[1, 2], [3, 4]])
>>> y_train = np.array([[1], [0]])
>>>
>>> optimizer = algorithms.IRPROPPlus(Input(2) > Sigmoid(3) > Sigmoid(1))
>>> network = Input(2) >> Sigmoid(3) >> Sigmoid(1)
>>> optimizer = algorithms.IRPROPPlus(network)
>>> optimizer.train(x_train, y_train)
References
Expand Down
4 changes: 2 additions & 2 deletions neupy/architectures/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def conv_name(index):

n_output_filters = 4 * n_input_filters
main_branch = layers.join(
# The main purpose of this 1x1 convolutional layer is to
# The main purpose of this 1x1 convolution layer is to
# reduce number of filters. For instance, for the tensor with
# 256 filters it can be reduced to 64. This trick allows to
# reduce computation by factor of 4.
Expand All @@ -30,7 +30,7 @@ def conv_name(index):
layers.BatchNorm(name=bn_name('2a')),
layers.Relu(),

# This convolutional layer applies 3x3 filter in order to
# This convolution layer applies 3x3 filter in order to
# extract features.
layers.Convolution(
(3, 3, n_input_filters),
Expand Down

0 comments on commit d379e5b

Please sign in to comment.