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
""" | |
from to https://towardsdatascience.com/how-to-scale-training-on-multiple-gpus-dae1041f49d2 | |
""" | |
import os | |
from datetime import datetime | |
import argparse | |
import torch.multiprocessing as mp | |
import torchvision | |
import torchvision.transforms as transforms | |
import torch |
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
from evdev import InputDevice, categorize, ecodes | |
from select import select | |
import Adafruit_PCA9685 | |
dev = InputDevice('/dev/input/event0') #event0 is the name of the bluetooth dongle | |
pwm = Adafruit_PCA9685.PCA9685() # RPi servo hat library | |
pwm.set_pwm_freq(50) | |
#Joystick value are in range [0, 255] | |
joystick_value = 128 #idle mode |
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
plot_flag = 0 | |
function plot(elt){ | |
Plotly.purge("graph") | |
if (plot_flag == 1){ | |
clearInterval(interval) | |
} | |
....... |
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
<html> | |
<head> | |
<script src="js/plotly-latest.min.js"></script> | |
<script> | |
function rand() { | |
return Math.random(); | |
} | |
// plot_cnt tells if function plot has been ran or not |
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> | |
myplot = document.getElementById('show_plot'); | |
Plotly.plot( myplot, [{ | |
x: [1, 2, 3, 4, 5], | |
y: [1, 2, 4, 8, 16] }], { | |
margin: { t:0 } } ); | |
</script> |
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
<div id="show_plot" style="width:600px; height:250px;"> </div> |
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
<header> | |
<script type="text/javascript" src="https://cdn.plot.ly/plotly-latest.min.js"> | |
</script> | |
</header> |
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
from plotly.offline import init_notebook_mode, iplot | |
from plotly.graph_objs import * | |
init_notebook_mode() | |
trace1 = Bar( | |
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], | |
y = [13, 13.2, 11.3, 12, 8.4, 9, 9.5, 6.5, 6.8, 4.3, 3.2, 2.8, 1.1, 0] | |
) | |
data = [trace1] |
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
from plotly.offline import init_notebook_mode, iplot | |
from plotly.graph_objs import * | |
init_notebook_mode() | |
trace0 = Scatter( | |
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], | |
y = [13, 13.2, 11.3, 12, 8.4, 9, 9.5, 6.5, 6.8, 4.3, 3.2, 2.8, 1.1, 0] | |
) | |
trace1 = Scatter( | |
x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], |
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
from plotly.offline import init_notebook_mode, iplot | |
from plotly.graph_objs import * | |
init_notebook_mode() | |
#Generate some data | |
data_x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] | |
data_y = [13, 13.2, 11.3, 12, 8.4, 9, 9.5, 6.5, 6.8, 4.3, 3.2, 2.8, 1.1, 0] | |
iplot([Scatter(x=data_x, y=data_y)]) |
NewerOlder