Skip to content

Instantly share code, notes, and snippets.

----------------------------
---- Interactive SQL II ----
----------------------------
set lc_messages to 'en_US.UTF-8';
-- Initial tables for small set
create table players (
------------------------------------
-- Script for Interactive Session --
------------------------------------
-- Have messages displayed in English
SET lc_messages TO 'en_US.UTF-8';
-- CREATE Employees -----------------------------------------------------------
from mpi4py import MPI
from io import StringIO
import numpy as np
import math
import sys
import time
comm = MPI.COMM_WORLD
size = comm.Get_size()
from mpi4py import MPI
from io import StringIO
import numpy as np
import math
import sys
import time
comm = MPI.COMM_WORLD
size = comm.Get_size()
#!/usr/bin/python3.5
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
#!/usr/bin/python3.5
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
@zhangce
zhangce / .m
Last active November 1, 2016 07:12
function [m n_fetchfull] = SVMq(X, y, m, lr, num_range)
n_examples = size(X, 1);
n_features = size(X, 2);
num_ranges = {};
num_ranges_array = [];
for j=1:n_features
num_ranges{j} = num_range * (floor(log(abs(m(j))+1)) + 1);
num_ranges_array = [num_ranges_array num_ranges{j}];
function m = SVMq(X, y, m, lr, num_range)
n_examples = size(X, 1);
n_features = size(X, 2);
num_ranges = {};
for j=1:n_features
num_ranges{j} = num_range;
end
X1 = quantize_minmaxfull(X, num_ranges);
// Copyright 2014 Hazy Research (http://i.stanford.edu/hazy)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// Copyright 2014 Hazy Research (http://i.stanford.edu/hazy)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,