New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File dependencies #244
Comments
This will not work in a Jupiter notebook. Just got it to work in MAC OSX terminal |
Is there any way to make this Neupy work with Jupiter notebooks or spyder in Anaconda? |
Jupyter. Autocorrect keeps on fixing it. |
You can find this function here: https://github.com/itdxer/neupy/blob/master/examples/competitive/utils.py |
It should have been |
Thank you
By the way, are you available for consultation. If so would there be a charge for your services?
R. Pantera
… On May 20, 2019, at 12:17 AM, Yurii Shevchuk ***@***.***> wrote:
You can find this function here: https://github.com/itdxer/neupy/blob/master/examples/competitive/utils.py <https://github.com/itdxer/neupy/blob/master/examples/competitive/utils.py>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#244?email_source=notifications&email_token=AAYECHZSBDQNXJSQ2O43Z53PWJF63A5CNFSM4HN6OM42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVX42MA#issuecomment-493866288>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAYECH26YORP2FZHLKHFDKLPWJF63ANCNFSM4HN6OM4Q>.
|
No, I'm not. Sorry, I don't have a lot of free time |
Jupyter Notebook
Untitled3
Last Checkpoint: 04/16/2018
(autosaved)
Current Kernel Logo
Logout
Python 3 Trusted
File
Edit
View
Insert
Cell
Kernel
Widgets
Help
Run
In [1]:
1
%matplotlib tk
2
import matplotlib.pyplot as plt
3
from sklearn import datasets
4
from neupy import algorithms, utils
5
6
from helpers import plot_2d_grid
7
8
9
plt.style.use('ggplot')
10
utils.reproducible()
11
12
13
if name == 'main':
14
GRID_WIDTH = 20
15
GRID_HEIGHT = 1
16
17
data, targets = datasets.make_moons(n_samples=400, noise=0.1)
18
data = data[targets == 1]
19
20
sofm = algorithms.SOFM(
21
n_inputs=2,
22
features_grid=(GRID_HEIGHT, GRID_WIDTH),
23
24
verbose=True,
25
shuffle_data=True,
26
27
# The winning neuron will be selected based on the
28
# Euclidean distance. For this task it's important
29
# that distance is Euclidean. Other distances will
30
# not give us the same results.
31
distance='euclid',
32
33
learning_radius=2,
34
# Reduce learning radius by 1 after every 20 epochs.
35
# Learning radius will be equal to 2 during first
36
# 20 epochs and on the 21st epoch it will be equal to 1.
37
reduce_radius_after=20,
38
39
# 2 Means that neighbour neurons will have high learning
40
# rates during the first iterations
41
std=2,
42
# Defines a rate at which parameter
std
will be reduced.43
# Reduction is monotonic and reduces after each epoch.
44
# In 50 epochs std = 2 / 2 = 1 and after 100 epochs
45
# std = 2 / 3 and so on.
46
reduce_std_after=50,
47
48
# Step (or learning rate)
49
step=0.3,
50
# Defines a rate at which parameter
step
will reduced.51
# Reduction is monotonic and reduces after each epoch.
52
# In 50 epochs step = 0.3 / 2 = 0.15 and after 100 epochs
53
# std = 0.3 / 3 = 0.1 and so on.
54
reduce_step_after=50,
55
)
56
sofm.train(data, epochs=20)
57
58
red, blue = ('#E24A33', '#348ABD')
59
60
plt.scatter(*data.T, color=blue)
61
plt.scatter(*sofm.weight, color=red)
62
63
weights = sofm.weight.reshape((2, GRID_HEIGHT, GRID_WIDTH))
64
plot_2d_grid(weights, color=red)
65
66
plt.show()
67
ModuleNotFoundError Traceback (most recent call last)
in
4 from neupy import algorithms, utils
5
----> 6 from helpers import plot_2d_grid
7
8
ModuleNotFoundError: No module named 'helpers'
I did not move any files from where the examples were installed. I did not find a "helpers" file related to neupy on my disk. I read all the fixes for that type of problem. After 4 hours I could not make this file work.
The text was updated successfully, but these errors were encountered: