This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ubuntu 16.04 | |
sudo apt-get update | |
CMake GUI | |
sudo apt-get install cmake-qt-gui | |
GTK2.0 | |
sudo apt-get install gtk2.0 | |
sudo apt-get install build-essential libgtk2.0-dev | |
============== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a code made to run 3-phase PWM drive stage with 6-transistors, in other words 3 half bridge transistors with an Arduino UNO | |
//This setup is made with User settings of DEAD TIME. So here the the dead time can be adjusted by user. const int dead_time = 10;//10 = 0.625 us | |
//The PWM work here with fix frequancy of 31.25kHz (Other settings may not work proper when use all 3 TIMERS, if you want more flexibilty use Arduino MEGA 2560 or some other plattform) | |
//Olle Welin [email protected] | |
// TL Transistor Low side of half bridge pair | |
// TH Transistor High side of half bridge pair | |
// PWM assignement at Arduino UNO is by following: | |
//~6 TL, PH0, TMR0, pwm_ph0 data value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
///Add advanced game avoid rectangles but catch circles | |
///Fix bugg in pinball_game.hpp (was work on raspierry pi but not on PC) replay_count was not set to 0 at init state. Now replay_count=0; | |
/// Only dependancy is OpenCV C++ library need to be installed | |
/// Update with gamma parameter now | |
/// Example of Reinforced Machine Learning attached on a simple Pinball game | |
/// The enviroment (enviroment = data feedback) for the Agient (Agient = machine learning system) | |
/// is the raw pixels 50x50 pixels (2500 input nodes) and 200 hidden nodes on 100 frames | |
/// So the input to hidden weights is 50x50x100x200 x4 bytes (float) = is 200Mbytes huges but it work anyway!! | |
///Enhancment to do in future. | |
///TODO: Add some layers of Convolutions (with unsupervised Learning for learning feature patches) will probably enhance preformance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a code made to run 3-phase PWM drive stage with 6-transistors, in other words 3 half bridge transistors with an Arduino UNO | |
//This setup is made with User settings of DEAD TIME. So here the the dead time can be adjusted by user. const int dead_time = 10;//10 = 0.625 us | |
//The PWM work here with fix frequancy of 31.25kHz (Other settings may not work proper when use all 3 TIMERS, if you want more flexibilty use Arduino MEGA 2560 or some other plattform) | |
//Olle Welin [email protected] | |
// TL Transistor Low side of half bridge pair | |
// TH Transistor High side of half bridge pair | |
// PWM assignement at Arduino UNO is by following: | |
//~6 TL, PH0, TMR0, pwm_ph0 data value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This is a code made to run 3-phase PWM drive stage with 6-transistors, in other words 3 half bridge transistors with an Arduino UNO | |
//This setup is made with User settings of DEAD TIME. So here the the dead time can be adjusted by user. const int dead_time = 10;//10 = 0.625 us | |
//The PWM work here with fix frequancy of 31.25kHz (Other settings may not work proper when use all 3 TIMERS, if you want more flexibilty use Arduino MEGA 2560 or some other plattform) | |
//Olle Welin [email protected] | |
// TL Transistor Low side of half bridge pair | |
// TH Transistor High side of half bridge pair | |
// PWM assignement at Arduino UNO is by following: | |
//~6 TL, PH0, TMR0, pwm_ph0 data value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Change some settings 2017-10-25 | |
/// Only dependancy is OpenCV C++ library need to be installed | |
/// Example of Reinforced Machine Learning attached on a simple Pinball game | |
/// The enviroment (enviroment = data feedback) for the Agient (Agient = machine learning system) | |
/// is the raw pixels 50x50 pixels (2500 input nodes) and 200 hidden nodes on 100 frames | |
/// So the input to hidden weights is 50x50x100x200 x4 bytes (float) = is 200Mbytes huges but it work anyway!! | |
///Enhancment to do in future. | |
///TODO: Add some layers of Convolutions (with unsupervised Learning for learning feature patches) will probably enhance preformance. | |
///TODO: Maybe add bias weigth is a good idee to enhance preformance or stability during training. | |
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Add gamma parameter and use dice and network probability for make action decisions UP/DOWN. | |
/// Example of Reinforced Machine Learning attached on a simple Pinball game | |
/// The enviroment (enviroment = data feedback) for the Agient (Agient = machine learning system) | |
/// is the raw pixels 50x50 pixels (2500 input nodes) and 200 hidden nodes on 100 frames | |
/// So the input to hidden weights is 50x50x100x200 x4 bytes (float) = is 200Mbytes huges but it work anyway!! | |
///Enhancment to do in future. | |
///TODO: Add some layers of Convolutions (with unsupervised Learning for learning feature patches) will probably enhance preformance. | |
///TODO: Maybe add bias weigth is a good idee to enhance preformance or stability during training. | |
///#define USE_PRINT_OUTPUT_NODE_VALUE ///Uncomment this to see print out of output node value. Only used for evaluation | |
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h>// exit(0); | |
float abs_value(float signed_value) | |
{ | |
float abs_v; | |
abs_v = signed_value; | |
if(abs_v < 0) | |
{ | |
abs_v = -abs_v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h>// exit(0); | |
float abs_value(float signed_value) | |
{ | |
float abs_v; | |
abs_v = signed_value; | |
if(abs_v < 0) | |
{ | |
abs_v = -abs_v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h>// exit(0); | |
float abs_value(float signed_value) | |
{ | |
float abs_v; | |
abs_v = signed_value; | |
if(abs_v < 0) | |
{ | |
abs_v = -abs_v; |
NewerOlder