Exemplo n.º 1
0
# drawtype="rbg" tries to draw colors on map - needs an input data with 3 vectors

# drawtype="black-white" draws black-white
# drawtype="networkx" graph drawing using the networkx library
# drawtype="None" - default draws empty space

# Also there is networkx graph drawing

# labels=True or False draws labels on the map... labels are necessary...

# draw_every_epoch=0 Don't draw anything
# draw_every_epoch=10 draw every 10 epochs
# -

map1.impact_matrix

labels = True
drawtype = "rbg"

# +
# Going through a large cycle combining of number of iteration whole cycles

map1.large_cycle(draw_every_epoch=100, drawtype=drawtype)
# -

# Drawing all the history
plt.rcParams['figure.dpi'] = 150
map1.draw_all(drawtype, labels=labels)

map1.draw_all(drawtype="networkx", labels=labels)
Exemplo n.º 2
0
data_lables = color_names
batch_size = 2

length = 10
width = 10
number_iterations = 100
shuffle = True

learning_rate = 0.01
# + {}
# trainloader = ""

# def load_data(data, batch_size=4):
#     dim = len(data[0])
#     number_rows_data = len(data)

#     trainloader = torch.utils.data.DataLoader(data, batch_size=batch_size, shuffle=True)

#     return trainloader, dim, number_rows_data
# -

map1 = MapClass(data, length, width, learning_rate, number_iterations, matrix1,
                data_lables, batch_size, shuffle)

# +
# training, dim, number_rows_data = load_data(data, batch_size)
# -

plt.rcParams['figure.dpi'] = 150
map1.large_cycle(draw_every_epoch=10, rgb=True)
Exemplo n.º 3
0
# Network configuration

data = digits.data
data_lables = digits.target
batch_size = 10

length = 10
width = 10
number_iterations = 100
shuffle = True

learning_rate = 0.01
# -

map1 = MapClass(data, length, width, learning_rate, number_iterations, matrix1,
                data_lables, batch_size, shuffle)

# +
# training, dim, number_rows_data = load_data(data, batch_size)
# -

plt.rcParams['figure.dpi'] = 150
map1.large_cycle(draw_every_epoch=10, rgb=False)

map1.weights.shape

for tr in map1.trainloader:
    #     print(tr)
    for t in tr:
        print(len(t))