示例#1
0
    def generateLayerMenus(self, numOfLayers):
        if isinstance(numOfLayers, int):
            menus = []
            for i in range(0, numOfLayers - 1):
                newMenu = ttk.Combobox(self.parent,
                                       state='readonly',
                                       values=list(range(1, self.maxNeurons)))
                newMenu.bind('<<ComboboxSelected>>', lambda x: \
                             self.parent.focus())
                menus.append(newMenu)

            # HyperParameters

            newMenu = ttk.Combobox(
                self.parent,
                state='readonly',
                values=PluginManager.getPluginNames('ActivationFunc'))
            newMenu.bind('<<ComboboxSelected>>', lambda x: \
                         self.parent.focus())
            menus.append(newMenu)
            newMenu = ttk.Combobox(
                self.parent,
                state='readonly',
                values=PluginManager.getPluginNames('ErrorFunc'))
            newMenu.bind('<<ComboboxSelected>>', lambda x: \
                         self.parent.focus())
            menus.append(newMenu)
            newMenu = Tk.Entry(self.parent)
            newMenu.insert(Tk.END, '0.1')
            menus.append(newMenu)
            self.menus = menus
        else:
            raise TypeError('"numOfLayers" has to be an int.')
示例#2
0
 def __init__(self, pcapfile, outputdir='output', entropy=False, **kwargs):
     self.kwargs = kwargs
     self.pcapfile = pcapfile
     self.filemanager = FileManager(outputdir)
     self.pm = PluginManager()
     self.outputdir = outputdir
     self.useEntropy = entropy
示例#3
0
 def __init__(self, pcapfile, outputdir='output', entropy=False, **kwargs):
     self.kwargs = kwargs
     self.pcapfile = pcapfile
     self.filemanager = FileManager(outputdir)
     self.pm = PluginManager()
     self.outputdir = outputdir
     self.useEntropy = entropy
     self.countfiles = 0
     self.emailscan = EmailScan.EmailScan()
     self.domainscan = DomainScan.DomainScan()
     self.ipscan = IPScan.IPScan()
示例#4
0
 def __init__(self,
              logger,
              pcapfile,
              outputdir='output',
              entropy=False,
              write_file_data=False,
              **kwargs):
     self.kwargs = kwargs
     self.pcapfile = pcapfile
     self.filemanager = FileManager(outputdir, write_file_data)
     self.pm = PluginManager()
     self.outputdir = outputdir
     self.useEntropy = entropy
     self.logger = logger
示例#5
0
 def setActivationFunc(self, ActivationFunc):
     if PluginManager.checkTypeValid(ActivationFunc):
         self.actFunc = ActivationFunc
示例#6
0
# -*- coding: utf-8 -*-

import random
from Plugins import PluginManager
import configparser
import numpy as np

config = configparser.ConfigParser()
config.read('config.ini')

ActivationFunctions = PluginManager.importPlugins('ActivationFunc')
ErrorFunctions = PluginManager.importPlugins('ErrorFunc')


class Neuron:

    # TotalNeurons is an incrementing int which keeps track of how many neurons have been created for naming

    TotalNeurons = 0

    # w is an array containing weights (ints)
    # @param Bias is a float
    # @param LearningRate is a float
    # @param activationFunction is a string

    def __init__(
        self,
        LearningRate,
        activationFunction,
        errorFunction,
    ):
示例#7
0
# -*- coding: utf-8 -*-

import tkinter as Tk
from tkinter import ttk
from Plugins import PluginManager
import configparser
import Globals

actFuncList = PluginManager.getPluginNames('ActivationFunc')
errFuncList = PluginManager.getPluginNames('ErrorFunc')

# Get Configs

config = configparser.ConfigParser()
config.read('config.ini')
colourScheme = config['colourScheme']
fonts = config['fonts']
neuralNet = config['neuralNet']
maxLayers = list(range(2, int(neuralNet['maxLayers']) + 1))

# Opens a window containing the variables of a given neuron
# @param neuron is the neuron obj


def newWindow(neuron):
    window = Tk.Toplevel()
    window.grab_current()
    window.title('Neuron')
    window.config(bg=colourScheme['background'])
    window.attributes('-topmost', 'true')
    window.maxsize(width=0, height=600)