Direkt zum Hauptbereich

Posts

Es werden Posts vom November, 2018 angezeigt.

Pi And More 11 - R Script For Neuronal Net And Training

This is the R script used to create and train the neuronal net for the Python project . Please consider that the lines for the export of the neuron weights are disabled by the comment marker #. ################################## # # COMMON SAMPLE DATA HANDLING # ################################## load_samples = function (filename, attrib) { data = read.csv(filename, sep = "\t" ) # Remove result column data = data[, -5 ] # Calculate all combination with count of measure points n = aggregate(x ~ run + subset, data = data, FUN = length) # Keep only measurement with 80 points n = n[n[, 3 ] == 80 ,] # Create the training data matrix for non-matches dataset = matrix(ncol = 80 , nrow = 0 ) # Fill up the training data matrix with the valid cases (n) of data and transpose it for (i in 1 : dim(n)[ 1 ]) dataset = rbind(dataset, t(data $ x[(data $ run == n[i, 1 ]) & (data $ subset == n[i, 2 ])])) # add class column dataset = cbind(c(attr...

Pi And More 11 - Python Blinker Class

This source code is part of the Python magnetic field sensor and detector project . This class only provides a simple flashing indicator light for the project. ######################################## # # Python Magnetic Field Logger and Detector # by Sebastian Folz # Introduced on Pi And More 11 # ######################################## # Don't use time module, because there is no valid time without WiFi import time import sqlite3 as lite from qmc5883 import QMC5883 import statistics # import functions for system calls from subprocess import call import sys # import pushbutton class from pushbutton import pushbutton, Push # import blink class from Blinker import Blink1, Blink2 from enum import Enum import RPi.GPIO as GPIO # fix copy bug with switched arguments from shutil import copyfile # Import own neural net class from MLP import MLNN TASTER = 38 LED = 40 LONG_CYCLES = 10 # 1.5 seconds COMMIT = 10 BINSIZE = 10 #...

Pi And More 11 - Python Pushbutton Class

As on PAM 11 in Trier introduced: Python-Logger-Class (Push Button Library) as part of the Python magnetic field logger and detector project . ######################################## # # Python Magnetic Field Logger and Detector # by Sebastian Folz # Pusbutton library - handles push buttons # Introduced on Pi And More 11 # ######################################## # import GPIO import RPi.GPIO as GPIO # enumerations from enum import Enum class Push (Enum): NONE = 0 SHORT_DOWN = 1 LONG_DOWN = 2 class pushbutton : #pushed = False def __init__ ( self ): GPIO . setmode(GPIO . BOARD) self . pushed = False self . pin = - 1 self . cycles = 0 def setLongCycle ( self , cycles): self . long_cycles = cycles; def configure ( self , aPin): self . pin = aPin GPIO . setup( self . pin, GPIO . IN, pull_up_down = GPIO . PUD_UP) def isPushed ( self ): # ...

Pi And More 11 - Python Magnetic Field Logger And Detector

As introduces atn PAM 11 in Trier: The Python-Logger-Class. This is the main class for my Raspberry Pi 3 machine learning experiment. Please consider, that three more classes are required: The QMC5883 driver class , the pushbutton class and the blinker class . Furthermore, the R script for the training of the neuronal net is required. ######################################## # # Python Magnetic Field Logger and Detector # by Sebastian Folz # Introduced on Pi And More 11 # ######################################## # Don't use time module, because there is no valid time without WiFi import time import sqlite3 as lite from qmc5883 import QMC5883 import statistics # import functions for system calls from subprocess import call import sys # import pushbutton class from pushbutton import pushbutton, Push # import blink class from Blinker import Blink1, Blink2 from enum import Enum import RPi.GPIO as GPIO # fix copy bug with switched argume...