Skip to content

Instantly share code, notes, and snippets.

View MikeLing's full-sized avatar
:octocat:
Busy

Tiramisu 1993 MikeLing

:octocat:
Busy
View GitHub Profile
matrix=[ 1, 0.357435345649719238, 0.881105303764343262, 0.264614194631576538, 0.392460733652114868, 0.29888606071472168, 0.77649921178817749, 0.392304211854934692, 0.415194451808929443, 0.284810483455657959, 0.0661987736821174622,0.264099746942520142, 0.346782028675079346, 0.25590476393699646, 0.805517375469207764, 0.192790955305099487, 0.913285493850708008, 0.15366363525390625, 0.567021012306213379, 0.133734241127967834, 0.969233214855194092, 0.247210726141929626, 0.792447865009307861, 0.175152182579040527, 0.331717342138290405, 0.210481196641921997, 0.645177245140075684, 0.271643549203872681, 0.341481983661651611, 0.206513836979866028, 0.0391497872769832611, 0.176229551434516907, 0.237540602684020996, 0.177651673555374146, 0.711493313312530518, 0.121511027216911316, 0.849533617496490479, 0.101873315870761871, 0.496741175651550293, 0.0933600813150405884, 0.071564696729
matrix=[[ 1, 0.357435345649719238, 0.881105303764343262, 0.264614194631576538, 0.392460733652114868, 0.29888606071472168, 0.77649921178817749, 0.392304211854934692, 0.415194451808929443, 0.284810483455657959, 0.0661987736821174622, 0.264099746942520142, 0.346782028675079346, 0.25590476393699646, 0.805517375469207764, 0.192790955305099487, 0.913285493850708008, 0.15366363525390625, 0.567021012306213379, 0.133734241127967834, 0.071564696729183197, 0.596106052398681641, 0.146366193890571594, 0.281917452812194824, 0.639549732208251953, 0.213880911469459534, 0.372015953063964844, 0.911623120307922363, 0.0226767528802156448, 0.0492779314517974854, 0.150228172540664673, 0.182678699493408203, 0.194619730114936829, 0.223039060831069946, 0.0562533959746360779, 0.177665024995803833, 0.0953366979956626892, 0.427403718233108521, 0.805513143539428711, 0.11347990483045578, 0.101488135
loat64_t CQuadraticTimeMMD::compute_statistic()
{
...
if (self->precompute)
{
SGMatrix<float32_t> kernel_matrix=self->get_kernel_matrix();
statistic=self->statistic_job(kernel_matrix);
SG_PRINT("kernel_matrix is"); // output is in https://pastebin.mozilla.org/9026733
kernel_matrix.display_matrix();
#include <shogun/base/init.h>
#include <shogun/base/some.h>
#include <shogun/labels/MulticlassLabels.h>
#include <shogun/lib/SGVector.h>
#include <shogun/io/SerializableAsciiFile.h>
#include <shogun/multiclass/ecoc/ECOCHDDecoder.h>
#include <shogun/features/DenseFeatures.h>
#include <shogun/multiclass/ecoc/ECOCStrategy.h>
#include <shogun/multiclass/ecoc/ECOCRandomDenseEncoder.h>
#include <shogun/machine/LinearMulticlassMachine.h>
#include "spdlog/spdlog.h"
class SGIO
{
public:
SGIO
{
...
}
// in init.hpp
__init32_t global_random_seed = CRandom::generate_seed();
// in CRanomd.hpp
extern __init32_t global_random_seed;
CRandom::CRandom() : m_sfmt_32(NULL),
m_sfmt_64(NULL),m_dsfmt(NULL)
class CSGObject
{
public:
void CSGObject::init()
{
m_rng = std::unique_ptr<CRandom>(new CRandom(m_seed));
}
static void set_global_seed(uint32_t seed)
{
CSGObject::m_seed = seed;
void CNeuralNetwork::set_seed(int32_t seed)
{
m_rng->set_seed(seed);
for (int32_t i=0; i<m_num_layers; i++)
{
get_layer(i)->set_seed(seed);
}
}
TEST(BinaryLabels, serialization)
{
CBinaryLabels* labels=new CBinaryLabels(10);
labels->set_values(SGVector<float64_t>(labels->get_num_labels()));
for (index_t i=0; i<labels->get_num_labels(); ++i)
labels->set_value(i%2==0 ? 1 : -1, i);
/* generate file name */
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.