Example #1
0
        internal VowpalWabbitAsync(VowpalWabbitThreadedLearning manager)
        {
            Contract.Requires(manager != null);
            Contract.Ensures(this.serializers != null);

            this.manager = manager;

            // create a serializer for each instance - maintaining separate example caches
            this.serializers = Enumerable
                               .Range(0, manager.Settings.ParallelOptions.MaxDegreeOfParallelism)
                               .Select(_ => VowpalWabbitSerializerFactory.CreateSerializer <TExample>(manager.Settings))
                               .ToArray();
        }
Example #2
0
        internal VowpalWabbitAsync(VowpalWabbitThreadedLearning manager)
        {
            Contract.Requires(manager != null);
            Contract.Ensures(this.serializers != null);

            this.manager = manager;

            // create a serializer for each instance - maintaining separate example caches
            var serializer = VowpalWabbitSerializerFactory.CreateSerializer <TExample>(manager.Settings);

            this.serializers = this.manager.VowpalWabbits
                               .Select(vw => serializer.Create(vw))
                               .ToArray();
        }