Skip to content

Instantly share code, notes, and snippets.

View cesarsouza's full-sized avatar

César Souza cesarsouza

View GitHub Profile
@cesarsouza
cesarsouza / accord-cla-v1.0.md
Last active August 10, 2018 13:07
Accord.NET's Contribution License Agreement v1.0

Contribution License Agreement

This Contribution License Agreement ("Agreement") is agreed to by the party signing below ("You"), and conveys certain license rights to the Accord.NET Framework original authors ("Accord.NET") for Your contributions to Accord.NET open source projects. This Agreement is effective as of the latest signature date below.

  1. Definitions.
    • "Code" means the computer software code, whether in human-readable or machine-executable form, that is delivered by You to Accord.NET under this Agreement.
    • "Project" means any of the projects owned or managed by Accord.NET in which software is offered under a license approved by the Open Source Initiative (OSI) (www.opensource.org) and documentation offered under an OSI or a Creative Commons license (https://creativecommons.org/licenses).
  • "Submit" is the act of uploading, submitting, transmitting, or distributing code or other content to any Project, including but not limited to communication on electronic ma
@cesarsouza
cesarsouza / phav-extract.sh
Created July 14, 2017 11:19
Short script to uncompress the PHAV dataset
#!/bin/sh
for file in */*.tar.bz2
do
tar xvkjf ${file} --strip-components 1 -C videos
done
@cesarsouza
cesarsouza / gist:f09198c8ebc29b5d648a
Created June 2, 2015 13:59
Simpler Accord.NET SVM creation
// Creating the model
let kernel = Linear()
let svm = new MulticlassSupportVectorMachine(features, kernel, classes)
// Creating the teacher
let learner = MulticlassSupportVectorLearning(svm, observations, labels)
learner.Algorithm <- fun svm x y _ _ ->
SequentialMinimalOptimization(svm, x, y)
@cesarsouza
cesarsouza / gist:aeb3c080c502ea5702b5
Created May 9, 2015 12:01
Missing Sort<T> method for Jagged matrices
/// <summary>
/// Sorts the columns of a matrix by sorting keys.
/// </summary>
///
/// <param name="keys">The key value for each column.</param>
/// <param name="values">The matrix to be sorted.</param>
/// <param name="comparer">The comparer to use.</param>
///
public static TValue[][] Sort<TKey, TValue>(TKey[] keys, TValue[][] values, IComparer<TKey> comparer)
{
@cesarsouza
cesarsouza / gist:1d4866c0d9d9e3f3cb71
Created May 8, 2015 13:06
Principal Component Analysis for Jagged matrices
// Accord Statistics Library
// The Accord.NET Framework
// http://accord-framework.net
//
// Copyright © César Souza, 2009-2015
// cesarsouza at gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
@cesarsouza
cesarsouza / gist:e78cd0933090ceef3ae1
Created January 22, 2015 21:39
How to create an independent Normal hidden Markov Model in Accord.NET
// Let's say we have 2 meteorological sensors gathering data
// from different time periods of the day. Those periods are
// represented below:
double[][][] data =
{
new double[][] // first sequence (we just repeated the measurements
{ // once, so there is only one observation sequence)
new double[] { 1, 2 }, // Day 1, 15:00 pm