Help with SQL commands to interact with a MySQL database
- Mac /usr/local/mysql/bin
- Windows /Program Files/MySQL/MySQL version/bin
- Xampp /xampp/mysql/bin
Nothing here, just a Gist hack to display the title correctly on Gist. | |
(Prefix the title of this file with a dot on Gist.) |
"""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 |
// Sample: download json as excel file (BOM + utf-16le encoding) | |
// reference: | |
// https://gist.github.com/maciejjankowski/2db91642fb9eaa771111f2c0538e4560 | |
// | |
<script> | |
function JSON2CSV(objArray) { | |
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; | |
var str = ''; | |
var line = ''; | |
// header |
function alpha=kriAlpha(data,scale) | |
% alpha=kriAlpha(data,scale) | |
% calculates Krippendorff's Alpha as a measure of inter-rater agreement | |
% data: rate matrix, each row is a rater or coder, each column is a case | |
% scale: level of measurement, supported are 'nominal', 'ordinal', 'interval' | |
% missing values have to be coded as NaN or inf | |
% For details about Krippendorff's Alpha see: | |
% http://en.wikipedia.org/wiki/Krippendorff%27s_Alpha | |
% Hayes, Andrew F. & Krippendorff, Klaus (2007). Answering the call for a |
def tf_pca(x): | |
''' | |
Compute PCA on the bottom two dimensions of x, | |
eg assuming dims = [..., observations, features] | |
''' | |
# Center | |
x -= tf.reduce_mean(x, -2, keepdims=True) | |
# Currently, the GPU implementation of SVD is awful. | |
# It is slower than moving data back to CPU to SVD there |
# This example shows how to use keras TensorBoard callback | |
# with model.train_on_batch | |
import tensorflow.keras as keras | |
# Setup the model | |
model = keras.models.Sequential() | |
model.add(...) # Add your layers | |
model.compile(...) # Compile as usual |
{ | |
"Statement": [ | |
{ | |
"Action": [ | |
"apigateway:*", | |
"cloudformation:CancelUpdateStack", | |
"cloudformation:ContinueUpdateRollback", | |
"cloudformation:CreateChangeSet", | |
"cloudformation:CreateStack", | |
"cloudformation:CreateUploadBucket", |
yalmip('clear') | |
T = [0 1 0 1; 1 0 1 0; 0 1 0 1; 1 0 1 0]; | |
x = sdpvar(4, 1); | |
y = sdpvar(4, 1); | |
assign(x, randn(4, 1)); | |
assign(y, randn(4, 1)); | |
const = [x'*x <= 1; y'*y <=1]; | |
% const = []; |
# ported from https://github.com/pvigier/perlin-numpy/blob/master/perlin2d.py | |
import torch | |
import math | |
def rand_perlin_2d(shape, res, fade = lambda t: 6*t**5 - 15*t**4 + 10*t**3): | |
delta = (res[0] / shape[0], res[1] / shape[1]) | |
d = (shape[0] // res[0], shape[1] // res[1]) | |
grid = torch.stack(torch.meshgrid(torch.arange(0, res[0], delta[0]), torch.arange(0, res[1], delta[1])), dim = -1) % 1 |