Example #1
0
# networkName = "cupNetworkSmall"
# networkName = "treeNetworkSmall"


layerToObserve = 1

binarize = False
samplesForAverage = 1

canvasWidth = 900
canvasHeight = 600

dbc = DatabaseConnector()
network = dbc.getNetwork(networkName)

rbm = DeepRBM(network.model)
rbm.setWeights(network.weights)

root = Tk()
root.geometry(str(canvasWidth) + "x" + str(canvasHeight))
canvas = Canvas(root, width=canvasWidth, height=canvasHeight)
canvas.pack()

references = []

for i in range(network.model[layerToObserve]):
    print "Sampling neuron " + str(i)

    myimg = Image.new("L", (network.imageWidth, network.imageHeight), "white")

    if samplesForAverage <= 1:
Example #2
0
from Tkinter import *
from PIL import Image, ImageTk
from DatabaseConnector import DatabaseConnector
from DeepRBM import DeepRBM
import numpy as np

networkName = "treeNetwork"

dbc = DatabaseConnector()
network = dbc.getNetwork(networkName)

rbm = DeepRBM(network.model)
rbm.setWeights(network.weights)

samplesForAverage = 10
binarize = True

imageWidth = network.imageWidth
imageHeight = network.imageHeight

input = np.random.randn(samplesForAverage, network.model[0])

flag = True
refreshRate = 1


def updateImage():
    global picture
    global flag
    global input
    global samplesForAverage
Example #3
0
from Tkinter import *
from PIL import Image, ImageTk
from DatabaseConnector import DatabaseConnector
from DeepRBM import DeepRBM
import numpy as np


networkName = "treeNetwork"

dbc = DatabaseConnector();
network = dbc.getNetwork(networkName);

rbm = DeepRBM(network.model)
rbm.setWeights(network.weights)

samplesForAverage = 10;
binarize = True;

imageWidth = network.imageWidth;
imageHeight = network.imageHeight;

input = np.random.randn(samplesForAverage, network.model[0]);

flag = True;
refreshRate = 1;

def updateImage():
    global picture
    global flag
    global input
    global samplesForAverage
Example #4
0
# networkName = "cupNetwork"
# networkName = "cupNetworkSmall"
# networkName = "treeNetworkSmall"

layerToObserve = 1

binarize = False
samplesForAverage = 1

canvasWidth = 900
canvasHeight = 600

dbc = DatabaseConnector()
network = dbc.getNetwork(networkName)

rbm = DeepRBM(network.model)
rbm.setWeights(network.weights)

root = Tk()
root.geometry(str(canvasWidth) + 'x' + str(canvasHeight))
canvas = Canvas(root, width=canvasWidth, height=canvasHeight)
canvas.pack()

references = []

for i in range(network.model[layerToObserve]):
    print "Sampling neuron " + str(i)

    myimg = Image.new("L", (network.imageWidth, network.imageHeight), "white")

    if (samplesForAverage <= 1):