mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
[pre-commit.ci] pre-commit autoupdate (#9543)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.291...v0.0.292) - [github.com/codespell-project/codespell: v2.2.5 → v2.2.6](https://github.com/codespell-project/codespell/compare/v2.2.5...v2.2.6) - [github.com/tox-dev/pyproject-fmt: 1.1.0 → 1.2.0](https://github.com/tox-dev/pyproject-fmt/compare/1.1.0...1.2.0) * updating DIRECTORY.md * Fix typos in test_min_spanning_tree_prim.py * Fix typos * codespell --ignore-words-list=manuel --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
![66853113+pre-commit-ci[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
60291738d2
commit
895dffb412
@ -2,7 +2,7 @@
|
||||
- - - - - -- - - - - - - - - - - - - - - - - - - - - - -
|
||||
Name - - CNN - Convolution Neural Network For Photo Recognizing
|
||||
Goal - - Recognize Handing Writing Word Photo
|
||||
Detail:Total 5 layers neural network
|
||||
Detail: Total 5 layers neural network
|
||||
* Convolution layer
|
||||
* Pooling layer
|
||||
* Input layer layer of BP
|
||||
@ -24,7 +24,7 @@ class CNN:
|
||||
self, conv1_get, size_p1, bp_num1, bp_num2, bp_num3, rate_w=0.2, rate_t=0.2
|
||||
):
|
||||
"""
|
||||
:param conv1_get: [a,c,d],size, number, step of convolution kernel
|
||||
:param conv1_get: [a,c,d], size, number, step of convolution kernel
|
||||
:param size_p1: pooling size
|
||||
:param bp_num1: units number of flatten layer
|
||||
:param bp_num2: units number of hidden layer
|
||||
@ -71,7 +71,7 @@ class CNN:
|
||||
with open(save_path, "wb") as f:
|
||||
pickle.dump(model_dic, f)
|
||||
|
||||
print(f"Model saved: {save_path}")
|
||||
print(f"Model saved: {save_path}")
|
||||
|
||||
@classmethod
|
||||
def read_model(cls, model_path):
|
||||
@ -210,7 +210,7 @@ class CNN:
|
||||
def train(
|
||||
self, patterns, datas_train, datas_teach, n_repeat, error_accuracy, draw_e=bool
|
||||
):
|
||||
# model traning
|
||||
# model training
|
||||
print("----------------------Start Training-------------------------")
|
||||
print((" - - Shape: Train_Data ", np.shape(datas_train)))
|
||||
print((" - - Shape: Teach_Data ", np.shape(datas_teach)))
|
||||
|
@ -158,7 +158,7 @@ if __name__ == "__main__":
|
||||
# G_b2 = np.random.normal(size=(784),scale=(1. / np.sqrt(784 / 2.))) *0.002
|
||||
G_b7 = np.zeros(784)
|
||||
|
||||
# 3. For Adam Optimzier
|
||||
# 3. For Adam Optimizer
|
||||
v1, m1 = 0, 0
|
||||
v2, m2 = 0, 0
|
||||
v3, m3 = 0, 0
|
||||
|
Reference in New Issue
Block a user