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 requests | |
from functools import partial | |
class LTSession(requests.Session): | |
def __init__(self, workspace:str,user:str,pwd:str,host:str=None): | |
"""[summary] | |
Initializes a LightTag API session object | |
Arguments: | |
workspace {str} -- [The name of your workspace] | |
user {str} -- [Your LightTag Username] | |
pwd {str} -- [Your LightTag password] |
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
@unpublished{LightTag, | |
AUTHOR = {Perry, Tal }, | |
TITLE = {{LightTag}: A platform for managing text annotation projects | |
YEAR = {2018}, | |
Note = {To appear} | |
} |
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
sudo yum update -y | |
sudo yum install -y docker | |
sudo usermod -a -G docker ec2-user | |
sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo service docker start | |
sudo chkconfig docker on | |
sudo systemctl enable docker |
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 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
self.alphas= tf.contrib.layers.fully_connected( | |
inputs=l2, | |
num_outputs=num_stocks+1, | |
activation_fn=tf.nn.relu, | |
weights_initializer=tf.initializers.glorot_uniform) | |
self.alphas +=1 | |
self.dirichlet = tfp.distributions.Dirichlet(self.alphas) | |
self.action = self.dirichlet._sample_n(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
import numpy as np | |
from collections import defaultdict | |
from env.priceGenerator import make_stock | |
costPerShare = 0 # 0.01 | |
class Env: | |
''' | |
A simple environemnt for our agent, | |
the action our agent gives is weighting over the stocks + cash |
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 | |
def make_stock(length=100, num_stocks=2): | |
alpha = 0.9 | |
k = 2 | |
cov = np.random.normal(0, 5, [num_stocks, num_stocks]) | |
cov = cov.dot(cov.T) # This is a positive semidefinite matrix, e.g. a covariance matrix | |
A = np.random.multivariate_normal(np.zeros(num_stocks), cov, size=[length]) # sample noise, with covariance | |
B = np.random.multivariate_normal(np.zeros(num_stocks), cov, size=[length]) # sample another noise, with covariance | |
bs = [np.zeros(shape=num_stocks)] # | |
ps = [np.zeros(shape=num_stocks)] # The prices |
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 pprint | |
import boto3 | |
import sys | |
repo_name = sys.argv[1] | |
print(repo_name) | |
client = boto3.client('ecr') | |
response = client.list_images( | |
repositoryName=repo_name, | |
filter={ | |
'tagStatus': 'TAGGED' |
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 pandas as pd | |
D = pd.read_csv('./my_csv_file.csv') | |
D.to_json('./my_new_json_file.json',orient="records") |
NewerOlder