Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
张 建国
onn在线训练
Commits
11b9efc9
Unverified
Commit
11b9efc9
authored
Jun 13, 2019
by
Alison Carrera
Committed by
GitHub
Jun 13, 2019
Browse files
Update README.md
parent
91d5ede0
Changes
1
Show whitespace changes
Inline
Side-by-side
README.md
View file @
11b9efc9
...
@@ -9,7 +9,25 @@ pip install onn
...
@@ -9,7 +9,25 @@ pip install onn
## How to use
## How to use
```
python
```
python
#Importing Library
from
onn.OnlineNeuralNetwork
import
ONN
#Starting a neural network with feature size of 2, hidden layers expansible until 5, number of neuron per hidden layer = 10 #and two classes.
onn_network
=
ONN
(
features_size
=
2
,
max_num_hidden_layers
=
5
,
qtd_neuron_per_hidden_layer
=
10
,
n_classes
=
2
)
#Do a partial training
onn_network
.
partial_fit
(
np
.
asarray
([[
0.1
,
0.2
]]),
np
.
asarray
([
0
]))
onn_network
.
partial_fit
(
np
.
asarray
([[
0.8
,
0.5
]]),
np
.
asarray
([
1
]))
#Predict classes
predictions
=
onn_network
.
predict
(
np
.
asarray
([[
0.1
,
0.2
],
[
0.8
,
0.5
]]))
Predictions
->
qarray
([
1
,
1
])
#Predict classes probabilities
predictions
=
onn_network
.
predict_proba
(
np
.
asarray
([[
0.1
,
0.2
],
[
0.8
,
0.5
]]))
Predictions
->
array
([[
0.5048331
,
0.50083154
],[
0.49516693
,
0.49916846
]],
dtype
=
float32
)
```
```
## New features
## New features
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment