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
# Path of eigen checked out from devlopement branch | |
cmake_minimum_required(VERSION 3.4) | |
project(Test) | |
set(CMAKE_CXX_FLAGS "-std=c++11") | |
include_directories(/Users/kris/Desktop/kmean/eigen-git-mirror) | |
add_executable(main eigen_example.cpp) | |
#include <algorithm> | |
#include <cmath> |
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
from joblib import Parallel, delayed | |
import Queue | |
import os | |
# Define number of GPUs available | |
N_GPU = 4 | |
# Put indices in queue | |
q = Queue.Queue(maxsize=N_GPU) | |
for i in range(N_GPU): |
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
#include <torch/torch.h> | |
#include <iostream> | |
#include <ATen/Parallel.h> | |
#include <ATen/Aten.h> | |
using namespace at; | |
// using namespace torch; | |
void submodular_select(Tensor candidate_points, Tensor features_done, Tensor features) | |
{ |
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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torchvision import datasets, transforms | |
def backward_hook_function(grad_out): | |
print(grad_out.shape) | |
print(grad_out.norm()) | |
# print("grad_norm", grad_in.norm()) |
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
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. | |
#include "cpu/vision.h" | |
template <typename scalar_t> | |
at::Tensor soft_nms_cpu_kernel(const at::Tensor& dets, | |
at::Tensor& scores, | |
const float threshold) { | |
AT_ASSERTM(!dets.type().is_cuda(), "dets must be a CPU tensor"); | |
AT_ASSERTM(!scores.type().is_cuda(), "scores must be a CPU tensor"); |
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
class SelectLoss: | |
""" | |
Selection based on Loss values of samples. | |
No need of rejection sampling. | |
""" | |
def __init__(self, X, Y, fwd_batch_size, batch_size, _, loss): | |
""" | |
:param loss: loss function | |
:param x_train: training dataN |
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
class SelectLoss: | |
""" | |
Selection based on Loss values of samples. | |
No need of rejection sampling. | |
""" | |
def __init__(self, X, Y, fwd_batch_size, batch_size, _, loss): | |
""" | |
:param loss: loss function | |
:param x_train: training dataN |
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
from __future__ import division | |
from __future__ import print_function | |
import numpy as np | |
import six | |
import argparse | |
import keras | |
import gzip | |
import tensorflow as tf | |
import pickle | |
import pandas as pd |
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
#include <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/rmsprop/rmsprop.hpp> | |
#include <mlpack/methods/ann/init_rules/gaussian_init.hpp> | |
#include <mlpack/methods/ann/rbm/spike_slab_rbm_policy.hpp> | |
#include <mlpack/methods/ann/rbm.hpp> | |
#include <mlpack/methods/ann/rbm/binary_rbm_policy.hpp> | |
#include <mlpack/methods/softmax_regression/softmax_regression.hpp> | |
#include <mlpack/core/optimizers/minibatch_sgd/minibatch_sgd.hpp> | |
#include <mlpack/core/optimizers/sgd/sgd.hpp> |
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
#include <mlpack/core.hpp> | |
#include <mlpack/core/optimizers/rmsprop/rmsprop.hpp> | |
#include <mlpack/methods/ann/init_rules/gaussian_init.hpp> | |
#include <mlpack/methods/ann/rbm/spike_slab_rbm_policy.hpp> | |
#include <mlpack/methods/ann/rbm.hpp> | |
#include <mlpack/methods/ann/rbm/binary_rbm_policy.hpp> | |
#include <mlpack/methods/softmax_regression/softmax_regression.hpp> | |
#include <mlpack/core/optimizers/minibatch_sgd/minibatch_sgd.hpp> | |
#include <mlpack/core/optimizers/sgd/sgd.hpp> |
NewerOlder