This file contains hidden or 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
/** | |
* | |
* Qualtrics_barebones_question_for_lif.js | |
* Javascript code to integrate Streamingbandit & Qualtrics. | |
* Sends an receives JSON to and from StreamingBandit server | |
* | |
**/ | |
/* --- insert as <script> into look and feel ---*/ |
This file contains hidden or 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
<strong>Eyewitness</strong> | |
Three suspects have been lined up by the police, and two witnesses are asked how certain they are of seeing each of the suspects at the crime-scene. Which subject would might have been at the crime scene, according to you? | |
<style type="text/css"> | |
.table { | |
width: 100%; | |
border: 1px solid #C0C0C0; | |
border-collapse: collapse; | |
padding: 5px; | |
} | |
.table th { |
This file contains hidden or 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
# Implementation of Lock in Feedback. | |
# -*- coding: utf-8 -*- | |
from libs.base import * | |
import numpy as np | |
import json | |
class Lif: | |
def __init__(self, theta, x0=1.0, A=1.4, T=100, gamma=.004, omega=0.8, lifversion=2): | |
self._set_parameters(x0, A, T, gamma, omega, lifversion) |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import libs.lif as lf | |
key = "question" | |
value = self.context['question'] | |
theta = self.get_theta(all_float=False, key=key, value=value) | |
Lif = lf.Lif(theta, x0=self.context['x0'], A=1.4 , T=100, gamma=.004, omega=.8, lifversion=2) | |
suggestion = Lif.suggest() |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import libs.lif as lf | |
key = "question" | |
value = self.context['question'] | |
theta = self.get_theta(all_float=False, key=key, value=value) | |
Lif = lf.Lif(theta, x0=self.context['x0'], A=1.4 , T=100, gamma=.004, omega=.8, lifversion=2) | |
Lif.update(self.action["t"],self.action["x"], self.reward) | |
self.set_theta(Lif, key=key, value=value) |
This file contains hidden or 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
import sys,random | |
import json | |
import asyncio,aiohttp,pymongo,time | |
import numpy as np | |
import matplotlib.pyplot as plt | |
MONGO_IP = "78.46.212.194" | |
MONGO_PORT = 27017 | |
SB_BASE_URL = "https://strm.mnds.org:8080" |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
#============================================================================== | |
# Reset IPython - may delete the following when not making use of Spyder IDE | |
from IPython import get_ipython | |
get_ipython().magic('reset -sf') | |
# import libraries |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
#============================================================================== | |
# Reset IPython - may delete the following when not making use of Spyder IDE | |
from IPython import get_ipython | |
get_ipython().magic('reset -sf') | |
#============================================================================== |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import libs.lif as lf | |
key = "question" | |
value = self.context['question'] | |
theta = self.get_theta(all_float=False, key=key, value=value) | |
Lif = lf.Lif(theta, x0=self.context['x0'], A=self.context['A'], T=150, gamma=.06, omega=1.0, lifversion=1) | |
Lif.update(self.action["t"],self.action["x"], self.reward) | |
self.set_theta(Lif, key=key, value=value) |
This file contains hidden or 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
#!/bin/sh | |
IP_ADDRESS="192.168.0.2" | |
ufw allow from $IP_ADDRESS to any port 4369 | |
ufw allow from $IP_ADDRESS to any port 8091 | |
ufw allow from $IP_ADDRESS to any port 8092 | |
ufw allow from $IP_ADDRESS to any port 11214 | |
ufw allow from $IP_ADDRESS to any port 11215 | |
ufw allow from $IP_ADDRESS to any port 11209 |