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
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script> | |
<div style="width:400px;"> | |
<canvas id="myChart" width="400" height="400"></canvas> | |
</div> | |
<button onclick="train()">Train the model 1 step</button> | |
<script> | |
const trainX = [ | |
3.3, |
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
############################################################## | |
# Calculate the average reward of a set of runs by averaging all the runs, similar to the contest scoring | |
# | |
# $ python3 ./scripts/calc_reward.py jerk-agentv12 | |
# 99.900000% done, reward: 6970.131268 | |
# | |
# https://medium.com/@tristansokol/making-fun-visuals-history-maps-and-other-tool-improvements-eb5ffe187fd3 | |
############################################################## | |
import numpy as np |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<script> | |
export default { | |
name: "paymentForm", | |
data: function() { | |
return { | |
errors: [], | |
masterpass: false, | |
applePay: false | |
}; | |
}, |
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
<template> | |
<div> | |
<div id="sq-ccbox"> | |
<!-- | |
You should replace the action attribute of the form with the path of | |
the URL you want to POST the nonce to (for example, "/process-card") | |
--> | |
<form id="nonce-form" novalidate action="path/to/payment/processing/page" method="post"> | |
<div class="errorbox"> | |
<div class="error" v-for="error in errors"> |
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
$ python -m venv projectname | |
$ source projectname/bin/activate | |
(venv) $ pip install ipykernel | |
(venv) $ ipython kernel install --user --name=projectname | |
(venv) jupyter notebook | |
# Kernel > Change Kernel > projectname |
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
Array.prototype.map.call( document.querySelectorAll('a.mr-3[href*="stargazers"]'), function(n){ | |
return Number(n.text.replace(',','')) | |
}).reduce(function(total,num){return total+num}); |
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
#!/usr/bin/python | |
import sys | |
import retro | |
import numpy as np | |
from os import listdir | |
from os.path import isfile, join, isdir, dirname, realpath | |
from PIL import Image | |
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 numpy as np | |
import os | |
dir_path = os.getcwd() | |
import sys | |
firstarg=sys.argv[1] | |
r, _, _ = np.loadtxt(dir_path+'/results/'+firstarg+'/monitor.csv', delimiter=',', unpack=True, skiprows=1) | |
l, _ = np.loadtxt(dir_path+'/results/'+firstarg+'/log.csv', delimiter=',', unpack=True, skiprows=1) | |
print('%f%% done, reward: %f' % (max(l)/10000 ,np.mean(r))) |
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 matplotlib.pyplot as plt | |
import numpy as np | |
import os | |
dir_path = os.getcwd() | |
r, l, t = np.loadtxt(dir_path+'/results/jerk-agentv10/monitor.csv', delimiter=',', unpack=True, skiprows=1) | |
fig = plt.figure(num=None, figsize=(14, 6), dpi=80, facecolor='w', edgecolor='k') | |
ax = fig.add_subplot(111) | |
ax.plot(t, r, c='b', label='Reward',linewidth=0.5) |