sudo pacman -S qemu python python-pip
sudo pacman -S qemu virt-manager virt-viewer dnsmasq vde2 bridge-utils openbsd-netcat
sudo pacman -S ebtables iptables
sudo systemctl enable libvirtd.service
sudo systemctl restart libvirtd.service
sudo virsh net-start default
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
import random | |
import math | |
import numpy as np | |
import pandas as pd | |
from pysc2.agents import base_agent | |
from pysc2.lib import actions | |
from pysc2.lib import features |
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
import numpy as np | |
from tensorforce.agents import PPOAgent | |
from tensorforce.execution import Runner | |
from tensorforce.contrib.openai_gym import OpenAIGym | |
# Create an OpenAIgym environment | |
# ReversedAddition-v0 | |
# CartPole-v0 | |
env = OpenAIGym('ReversedAddition-v0', visualize=False) |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
func main() { | |
X := [][]float32{ | |
[]float32{1.0, 2.0, 3.0}, |
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
# Author: Costa Huang ([email protected]) | |
# References include | |
# https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/linear_regression.py | |
# https://stackoverflow.com/a/42861919/6611317 | |
import tensorflow as tf | |
import numpy | |
import matplotlib.pyplot as plt | |
tf.reset_default_graph() | |
# Parameters |
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
def derivative(func, x): | |
h = 1e-10 | |
x_d = np.full_like(x, 0) # the derivatives | |
x_c = x.copy() | |
for idx, value in np.ndenumerate(x): | |
x_c[idx] += h | |
x_d[idx] = (func(x_c) - func(x)) / h | |
x_c[idx] -= h | |
return x_d |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>S3 Bucket Listing Generator</title> | |
</head> | |
<body> | |
<div id="navigation"></div> | |
<div id="listing"></div> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> |
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
# https://github.com/hill-a/stable-baselines/blob/06f5843a3254ab7c2f6c927792e00365a778009e/stable_baselines/common/input.py#L6 | |
def observation_input(ob_space, batch_size=None, name='Ob', scale=False): | |
""" | |
Build observation input with encoding depending on the observation space type | |
When using Box ob_space, the input will be normalized between [1, 0] on the bounds ob_space.low and ob_space.high. | |
:param ob_space: (Gym Space) The observation space | |
:param batch_size: (int) batch size for input | |
(default is None, so that resulting input placeholder can take tensors with any batch size) |
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
# Reference: http://inoryy.com/post/tensorflow2-deep-reinforcement-learning/ | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.nn.functional as F | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.nn.functional as F | |
from torch.distributions.categorical import Categorical |
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
# Reference: http://inoryy.com/post/tensorflow2-deep-reinforcement-learning/ | |
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
import torch.nn.functional as F | |
from torch.distributions.categorical import Categorical | |
from tensorboardX import SummaryWriter | |
import argparse |
OlderNewer