Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 <vector> | |
#include <iostream> | |
#include <tuple> | |
template <typename T> | |
void print(const std::vector<T>& vec) | |
{ | |
for (const auto& el: vec) | |
std::cout << el << ", "; | |
std::cout << "\n"; |
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 numpy as np | |
import shogun as sg | |
from sklearn import datasets | |
X, y = datasets.load_breast_cancer(True) | |
y[y==0] = -1 | |
feat = sg.features(X.T) | |
kernel1 = sg.kernel("GaussianKernel") |
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 <shogun/base/init.h> | |
#include <shogun/base/some.h> | |
#include <shogun/features/Features.h> | |
#include <shogun/io/File.h> | |
#include <shogun/io/SerializableAsciiFile.h> | |
#include <shogun/kernel/Kernel.h> | |
#include <shogun/labels/Labels.h> | |
#include <shogun/lib/DynamicObjectArray.h> | |
#include <shogun/lib/SGVector.h> | |
#include <shogun/machine/Machine.h> |
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 <iostream> | |
#include <cxxabi.h> | |
// compile: g++ -std=c++14 index_to_type.cpp -o index_to_type | |
// demangle types for console output | |
std::string demangled_type_helper(const char *name) { | |
size_t length; | |
int status; | |
char *demangled = abi::__cxa_demangle(name, nullptr, &length, &status); |
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 keras | |
import keras.backend as K | |
import numpy as np | |
# keras version of adaptive learning with cosine annealing | |
# with cycles inspired by http://course.fast.ai/lessons/lesson2.html | |
class CosineAnnealingAdaptiveLRScheduler(keras.callbacks.Callback): |