本文整理汇总了C#中VowpalWabbit.HashSpaceNative方法的典型用法代码示例。如果您正苦于以下问题:C# VowpalWabbit.HashSpaceNative方法的具体用法?C# VowpalWabbit.HashSpaceNative怎么用?C# VowpalWabbit.HashSpaceNative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VowpalWabbit
的用法示例。
在下文中一共展示了VowpalWabbit.HashSpaceNative方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InternalTestHash
private void InternalTestHash(string args)
{
var stopWatchNative = new Stopwatch();
var stopWatchManaged = new Stopwatch();
using (var vw = new VowpalWabbit(args))
{
for (int i = 0; i < 10000; i++)
{
foreach (var item in data)
{
stopWatchNative.Start();
var nativeHash = vw.HashSpaceNative(item);
stopWatchNative.Stop();
stopWatchManaged.Start();
var managedHash = vw.HashSpace(item);
stopWatchManaged.Stop();
Assert.AreEqual(nativeHash, managedHash, item);
}
}
}
Console.WriteLine("Args: " + args);
Console.WriteLine("native: {0}", stopWatchNative.Elapsed);
Console.WriteLine("managed: {0}", stopWatchManaged.Elapsed);
}
示例2: TestHashUnicodeSpace
public void TestHashUnicodeSpace()
{
using (var vw = new VowpalWabbit(""))
{
var value = "ArticleTitleThe_25_Biggest_Art_Moments_of_2012" + (char)160;
// Encoding.UTF8.GetMaxByteCount
var nativeHash = vw.HashSpaceNative(value);
var managedHash = vw.HashSpace(value);
Assert.AreEqual(nativeHash, managedHash);
}
}