mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
pyupgrade --py37-plus **/*.py (#1654)
* pyupgrade --py37-plus **/*.py * fixup! Format Python code with psf/black push
This commit is contained in:

committed by
John Law

parent
34c808b375
commit
28419cf839
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
# encoding=utf8
|
||||
|
||||
"""
|
||||
|
||||
@ -31,6 +30,7 @@ class DenseLayer:
|
||||
"""
|
||||
Layers of BP neural network
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self, units, activation=None, learning_rate=None, is_input_layer=False
|
||||
):
|
||||
@ -99,6 +99,7 @@ class BPNN:
|
||||
"""
|
||||
Back Propagation Neural Network model
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.layers = []
|
||||
self.train_mse = []
|
||||
|
@ -1,5 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
- - - - - -- - - - - - - - - - - - - - - - - - - - - - -
|
||||
Name - - CNN - Convolution Neural Network For Photo Recognizing
|
||||
@ -286,7 +284,7 @@ class CNN:
|
||||
self.thre_bp3 = self.thre_bp3 - pd_k_all * self.rate_thre
|
||||
self.thre_bp2 = self.thre_bp2 - pd_j_all * self.rate_thre
|
||||
# calculate the sum error of all single image
|
||||
errors = np.sum(abs((data_teach - bp_out3)))
|
||||
errors = np.sum(abs(data_teach - bp_out3))
|
||||
alle = alle + errors
|
||||
# print(' ----Teach ',data_teach)
|
||||
# print(' ----BP_output ',bp_out3)
|
||||
|
@ -17,9 +17,6 @@
|
||||
This module and all its submodules are deprecated.
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
|
||||
import collections
|
||||
import gzip
|
||||
@ -115,7 +112,7 @@ def _extract_labels(f, one_hot=False, num_classes=10):
|
||||
return labels
|
||||
|
||||
|
||||
class _DataSet(object):
|
||||
class _DataSet:
|
||||
"""Container class for a _DataSet (deprecated).
|
||||
|
||||
THIS CLASS IS DEPRECATED.
|
||||
@ -165,7 +162,7 @@ class _DataSet(object):
|
||||
else:
|
||||
assert (
|
||||
images.shape[0] == labels.shape[0]
|
||||
), "images.shape: %s labels.shape: %s" % (images.shape, labels.shape)
|
||||
), f"images.shape: {images.shape} labels.shape: {labels.shape}"
|
||||
self._num_examples = images.shape[0]
|
||||
|
||||
# Convert shape from [num examples, rows, columns, depth]
|
||||
|
Reference in New Issue
Block a user