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
TORCH_CUDA_ARCH_LIST=8.6 | |
HOST_API_PORT=3389 | |
HOST_PORT=8888 | |
CONTAINER_PORT=7860 | |
CONTAINER_API_PORT=5000 | |
BUILD_EXTENSIONS="" | |
TRANSFORMERS_CACHE=/home/app/text-generation-webui/cache/ | |
HF_HOME=/home/app/text-generation-webui/cache/ | |
COMPOSE_PROJECT_NAME=trc #name for container will be trc_{service} |
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
# problem: sometimes we want a network that will start with a layer equal to the number of input neurons with fewer and fewer neurons in each subsequent neuron | |
class DenseLayer(k.layers.Layer): | |
def __init__(self): | |
super().__init__() | |
def build(self,input_shape): | |
self.layer_list=[] | |
size=input_shape[-1] | |
print(size) |
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 logging | |
logging.basicConfig(format='|%(levelname)s| (%(name)s) %(lineno)d:> %(message)s',datefmt='%m/%d/%Y %H:%M:%S') | |
logger=logging.getLogger(name=__file__) | |
ld=logger.debug | |
li=logger.info | |
lw=logger.warning | |
logger.setLevel(logging.DEBUG) |
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 tensorflow as tf | |
class GWData(object): | |
""" | |
# usage: make a dataset by passing in a tfrecord. Format will need to line up with output produced in tf_record_writer.py | |
# For a more easily workable example: https://gist.github.com/trcook/9fc8698cf7dc848a953f8e7a7e5f1aad | |
:Example: |
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
\usepackage[]{gitinfo2} | |
\begin{document} | |
\begin{tikzpicture}[remember picture,overlay] | |
\node at ([xshift=3cm,yshift=2cm]current page.south west) {\tiny \color[gray]{.8} Last Revised: \gitAuthorDate}; %% yshift and xshift for example only | |
\end{tikzpicture} | |
\end{document} |
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 keras as K | |
from keras.models import Sequential | |
from sklearn.preprocessing import MinMaxScaler | |
import pandas as pd | |
import numpy as np | |
import fredapi | |
fred_key="ADD FRED KEY FILE HERE" | |
fred=fredapi.fred.Fred(api_key_file=fred_key) |
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
def input_fn(total_repeats=int(1e8),batch_size=100): | |
x=tf.constant([ | |
[[0,1]], | |
[[0,0]], | |
[[1,1]], | |
[[1,0]] | |
],dtype=tf.float32) | |
y=tf.constant([ |
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 keras import backend as K | |
import keras as k | |
from keras.layers import * | |
import tensorflow as tf | |
tf.reset_default_graph() | |
g=tf.get_default_graph() | |
sess=tf.Session() | |
K.set_session(sess) |
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
# enter into jupyter cell and execute | |
from IPython.core.display import display, HTML | |
display(HTML("<style>.container { width:100% !important; }</style>")) |
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
chflags nohidden ~/Library/ |
NewerOlder