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
function totalRewards = simulate_epsg_n_bandit(n, eps, gamecnt, rollcnt) | |
# make room for the estimated value - action [Q_t(a)] | |
totalRewards = zeros(1, rollcnt); | |
for k = 1:gamecnt | |
# generate the true value - action [q_*(a)] from a normal distribution of mean 0 and variance 1 | |
q = randn(1, n); | |
# reset some game related, auxiliary variables | |
Qavg = zeros(1, n); |
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
# the optimization consists in the elimination of the 'Qsum' variable from the normal case and modifying | |
# 'Qavg' directly using a simple mathematica observation as Rich Sutton elegantly demonstrates | |
# in section 2.4 | |
function totalRewards = simulate_epsg_n_bandit(n, eps, gamecnt, rollcnt) | |
# make room for the estimated value - action [Q_t(a)] | |
totalRewards = zeros(1, rollcnt); | |
for k = 1:gamecnt | |
# generate the true value - action [q_*(a)] from a normal distribution of mean 0 and variance 1 |
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
static void ResolveClassFieldsAndMethods(const ParallelCompilationManager* manager, | |
size_t class_def_index) | |
LOCKS_EXCLUDED(Locks::mutator_lock_) { | |
ATRACE_CALL(); | |
Thread* self = Thread::Current(); | |
jobject jclass_loader = manager->GetClassLoader(); | |
const DexFile& dex_file = *manager->GetDexFile(); | |
ClassLinker* class_linker = manager->GetClassLinker(); | |
// If an instance field is final then we need to have a barrier on the return, static final |
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
(*Autor : Victor ADĂSCĂLIȚEI [2013], Scris pentru Mathematica v8; | |
Descriere : | |
Secvența de cod a fost folosită pentru construirea de | |
modele matematice liniare [polinoame de gradul 1] în | |
vederea extinderii capacității plăcuței Atmel XMEGA-A3BU | |
Xplained de a citi temperatura ambientală. | |
Principiul poate fi folosit pentru calcularea polinoamelor | |
de aproximare si pentru alte familii de termistori pentru | |
care exista informatii extinse precum foi de catalog din | |
care să poată fi calculat parametrii modelului |
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
/** | |
* \brief Read the actual temperature from the NTC | |
* | |
* This function returns the temperature in Celsius by piecewise linearisation | |
* of the complex transfer function between NTC resistance and ADC codes. The | |
* accuracy of the temperature is somewhat limited. | |
* | |
* \note The result is inaccurate for temperatures outside 5-45 degrees. | |
* | |
* \retval the temperature in Celsius |
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
/** | |
* \brief Citește temperatura reală a termistorului | |
* | |
* Funcția returnează temperatura în grade Celsius pe tot domeniul de | |
* referință a termistorului [-40 - 125] folosit de plăcuța XMEGA-A3BU. | |
* Eroare de calculare a valorii se va considera ca fiind aproximativ 1°C. | |
* | |
* \retval temperatura exprimată în grade Celsius [°C] | |
*/ | |
int8_t ntc_get_full_temperature(uint16_t adcVal) { |
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
/* | |
* Modul de comunicatii AVR-PS/2 Mouse | |
* Copyright (c) 2013, Victor ADASCALITEI, admin@tuscale.ro | |
* | |
* Eliberez aceste surse sub licenta CC de tip BY-NC-SA 3.0 . Pentru mai multe informatii, va invit sa accesati | |
* urmatoarea adresa : http://creativecommons.org/licenses/by-nc-sa/3.0/ro/ . | |
*/ | |
#include <avr/interrupt.h> | |
#define F_CPU 9600000UL |
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
/* | |
* Aplicatie test pentru Modulul de comunicatii AVR-PS/2 Mouse | |
* Copyright (c) 2013, Victor ADASCALITEI, admin@tuscale.ro | |
* | |
* Eliberez aceste surse sub licenta CC de tip BY-NC-SA 3.0 . Pentru mai multe informatii, va invit sa accesati | |
* urmatoarea adresa : http://creativecommons.org/licenses/by-nc-sa/3.0/ro/ . | |
*/ | |
#include <avr/io.h> |
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 "FastPWM.h" | |
FastPWM::FastPWM(PinName pin) : PWMObject(pin){ | |
//Set clock source | |
LPC_SC->PCLKSEL0|=1<<12; | |
_duty=0; | |
_period=0.02; | |
if (pin==p26||pin==LED1) { | |
PWMUnit=1; |
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
addr : out std_logic_vector (SDR_ADDR_WIDTH - 1 downto 0); | |
data : in std_logic_vector (SDR_DATA_WIDTH - 1 downto 0); | |
... | |
addr(addr'length - 1 downto 0) <= data(addr'length - 1 downto 0); |
OlderNewer