| name | explain-diff-html |
|---|---|
| description | Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output. |
Please make me a rich, interactive explanation of the specified code change.
It should have these sections:
| [Unit] | |
| Description=Jupyter Notebook | |
| [Service] | |
| Type=simple | |
| ExecStart=/home/roeyd/Notebook/.env/bin/jupyter lab --port 9090 | |
| WorkingDirectory=/home/roeyd/Notebook | |
| [Install] | |
| WantedBy=default.target |
| """An example of how to use tf.Dataset in Keras Model""" | |
| import tensorflow as tf # only work from tensorflow==1.9.0-rc1 and after | |
| _EPOCHS = 5 | |
| _NUM_CLASSES = 10 | |
| _BATCH_SIZE = 128 | |
| def training_pipeline(): | |
| # ############# | |
| # Load Dataset |
| class TokenizeLookupLayer(keras.layers.Layer): | |
| """ | |
| Layer that encapsulates the following: | |
| - Tokenizing sentences by space (or given delimiter) | |
| - Looking up the words with a given vocabulary list / table | |
| - Resetting the shape of the above to be batch_size x pad_len (using dark magic) | |
| # Input Shape | |
| 2D string tensor with shape `(batch_size, 1)` | |
| # Output Shape | |
| 2D int32 tensor with shape `(batch_size, pad_len)` |
| WITH tokens AS ( | |
| -- Just edit MY_TABLE, MY_TEXT_COL, and MY_PKEY_COL, and watch it go! | |
| SELECT MY_PKEY_COL AS pkey, (unnest(to_tsvector(MY_TEXT_COL))).* FROM MY_TABLE | |
| ), token_stream AS ( | |
| SELECT pkey, unnest(positions) AS token_idx, lexeme | |
| FROM tokens ORDER BY pkey, token_idx | |
| ), token_counts AS ( | |
| SELECT lexeme, sum(count) AS count | |
| FROM ( | |
| SELECT lexeme, array_length(positions, 1) AS count FROM tokens |
| # Use envFrom to load Secrets and ConfigMaps into environment variables | |
| apiVersion: apps/v1beta2 | |
| kind: Deployment | |
| metadata: | |
| name: mans-not-hot | |
| labels: | |
| app: mans-not-hot | |
| spec: | |
| replicas: 1 |
| logging.basicConfig(format='%(levelname)s:%(asctime)s.%(msecs)03d [%(threadName)s] - %(message)s', | |
| datefmt='%Y-%m-%d,%H:%M:%S', | |
| level=getattr(logging, os.getenv('LOG_LEVEL', 'INFO'))) |
| #!/usr/bin/env python | |
| #-*- coding: utf-8 -*- | |
| # RescueTime Data Exporter | |
| # Dan Nixon | |
| # 18/09/2011 | |
| # forked from Chris Burgess (xurizaemon) | |
| import urllib | |
| import datetime |
| // Client-side parser for .npy files | |
| // See the specification: http://docs.scipy.org/doc/numpy-dev/neps/npy-format.html | |
| var NumpyLoader = (function () { | |
| function asciiDecode(buf) { | |
| return String.fromCharCode.apply(null, new Uint8Array(buf)); | |
| } | |
| function readUint16LE(buffer) { | |
| var view = new DataView(buffer); | |
| var val = view.getUint8(0); |