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 | |
def compute_scale_and_shift(prediction, target, mask): | |
# system matrix: A = [[a_00, a_01], [a_10, a_11]] | |
a_00 = torch.sum(mask * prediction * prediction, (1, 2)) | |
a_01 = torch.sum(mask * prediction, (1, 2)) | |
a_11 = torch.sum(mask, (1, 2)) |
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
using System; | |
using OSX.Foundation; | |
class Driver { | |
static void Main (string[] args) { | |
var str = new NSString ("This is an objc string"); | |
Console.WriteLine ("Dump: {0} {1}", str == null, str); | |
} | |
} | |
basalt:OSX.x64.Debug plasma$ ./corerun -c . hw.exe |
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
/// Markov chain that learns by observing data. | |
/// Let it observe a sequence of states. | |
/// Then you can ask it, given a state, | |
/// what are the probabilities of the next states occuring? | |
/// This chain can remember history to make better predictions. | |
type MarkovChain (numStates : int, memory : int) = | |
let numPrevious = 1 + memory | |
let matrixSize = int (System.Math.Pow (float numStates, float numPrevious)) |
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
module Praeclarum.AutoLayout | |
open System | |
#if __IOS__ | |
open Foundation | |
open UIKit | |
type NativeView = UIView | |
#else | |
open Foundation |
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
public static double DiceCoefficient(string stOne, string stTwo) | |
{ | |
HashSet<string> nx = BuildBigramSet(stOne); | |
HashSet<string> ny = BuildBigramSet(stTwo); | |
HashSet<string> intersection = new HashSet<string>(nx); | |
intersection.IntersectWith(ny); | |
double dbOne = intersection.Count; | |
return (2 * dbOne) / (nx.Count + ny.Count); |
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
#r "System.Xml.dll" | |
#r "System.Runtime.Serialization.dll" | |
open Microsoft.FSharp.Reflection | |
open System.IO | |
open System.Reflection | |
open System.Runtime.Serialization | |
open System.Runtime.Serialization.Formatters.Binary | |
open System.Runtime.Serialization.Json | |
open System.Text |
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
<CustomCommands> | |
<CustomCommands> | |
<Command type="BeforeBuild" command="rm -rf ${SolutionDir}/Output/Payload/${ProjectName}.app/" /> | |
<Command type="BeforeBuild" command="rm -rf ${SolutionDir}/${ProjectName}.ipa" /> | |
<Command type="AfterBuild" command="cp -r ${ProjectDir}/bin/${ProjectConfigPlat}/${ProjectConfigName}/${ProjectName}.app ${SolutionDir}/Output/Payload/${ProjectName}.app" workingdir="" /> | |
<Command type="AfterBuild" command="zip -r ../${ProjectName}.ipa ." workingdir="${SolutionDir}/Output/" /> | |
<Command type="AfterBuild" command="curl http://testflightapp.com/api/builds.json -F file=@../${ProjectName}.ipa -F api_token='<your_api_token>' -F team_token='<your_team_token>'' -F notes='Uploaded Automatically From MonoDevelop' -F notify=false -F distribution_lists='<any dist lists you want to include>'" /> | |
</CustomCommands> | |
</CustomCommands> |