@@ -32,16 +32,16 @@ VowpalWabbit::VowpalWabbit(VowpalWabbitSettings^ settings)
32
32
}
33
33
34
34
if (settings->ParallelOptions != nullptr )
35
- { m_vw->selected_all_reduce_type = all_reduce_type::THREAD;
35
+ { m_vw->runtime_config . selected_all_reduce_type = all_reduce_type::THREAD;
36
36
auto total = settings->ParallelOptions ->MaxDegreeOfParallelism ;
37
37
38
38
if (settings->Root == nullptr )
39
- { m_vw->all_reduce .reset (new all_reduce_threads (total, settings->Node ));
39
+ { m_vw->runtime_state . all_reduce .reset (new all_reduce_threads (total, settings->Node ));
40
40
}
41
41
else
42
- { auto parent_all_reduce = (all_reduce_threads*)settings->Root ->m_vw ->all_reduce .get ();
42
+ { auto parent_all_reduce = (all_reduce_threads*)settings->Root ->m_vw ->runtime_state . all_reduce .get ();
43
43
44
- m_vw->all_reduce .reset (new all_reduce_threads (parent_all_reduce, total, settings->Node ));
44
+ m_vw->runtime_state . all_reduce .reset (new all_reduce_threads (parent_all_reduce, total, settings->Node ));
45
45
}
46
46
}
47
47
@@ -64,9 +64,9 @@ void VowpalWabbit::Driver()
64
64
}
65
65
66
66
void VowpalWabbit::RunMultiPass ()
67
- { if (m_vw->numpasses > 1 )
67
+ { if (m_vw->runtime_config . numpasses > 1 )
68
68
{ try
69
- { m_vw->do_reset_source = true ;
69
+ { m_vw->runtime_state . do_reset_source = true ;
70
70
VW::start_parser (*m_vw);
71
71
LEARNER::generic_driver (*m_vw);
72
72
VW::end_parser (*m_vw);
@@ -79,17 +79,17 @@ VowpalWabbitPerformanceStatistics^ VowpalWabbit::PerformanceStatistics::get()
79
79
{ // see parse_args.cc:finish(...)
80
80
auto stats = gcnew VowpalWabbitPerformanceStatistics ();
81
81
82
- if (m_vw->current_pass == 0 )
82
+ if (m_vw->passes_config . current_pass == 0 )
83
83
{ stats->NumberOfExamplesPerPass = m_vw->sd ->example_number ;
84
84
}
85
85
else
86
- { stats->NumberOfExamplesPerPass = m_vw->sd ->example_number / m_vw->current_pass ;
86
+ { stats->NumberOfExamplesPerPass = m_vw->sd ->example_number / m_vw->passes_config . current_pass ;
87
87
}
88
88
89
89
stats->WeightedExampleSum = m_vw->sd ->weighted_examples ();
90
90
stats->WeightedLabelSum = m_vw->sd ->weighted_labels ;
91
91
92
- if (m_vw->holdout_set_off )
92
+ if (m_vw->passes_config . holdout_set_off )
93
93
if (m_vw->sd ->weighted_labeled_examples > 0 )
94
94
stats->AverageLoss = m_vw->sd ->sum_loss / m_vw->sd ->weighted_labeled_examples ;
95
95
else
@@ -100,7 +100,7 @@ VowpalWabbitPerformanceStatistics^ VowpalWabbit::PerformanceStatistics::get()
100
100
stats->AverageLoss = m_vw->sd ->holdout_best_loss ;
101
101
102
102
float best_constant; float best_constant_loss;
103
- if (get_best_constant (*m_vw->loss , *m_vw->sd , best_constant, best_constant_loss))
103
+ if (get_best_constant (*m_vw->loss_config . loss , *m_vw->sd , best_constant, best_constant_loss))
104
104
{ stats->BestConstant = best_constant;
105
105
if (best_constant_loss != FLT_MIN)
106
106
{ stats->BestConstantLoss = best_constant_loss;
@@ -124,7 +124,7 @@ uint64_t VowpalWabbit::HashSpace(String^ s)
124
124
}
125
125
126
126
uint64_t VowpalWabbit::HashFeature (String^ s, size_t u)
127
- { auto newHash = m_hasher (s, u) & m_vw->parse_mask ;
127
+ { auto newHash = m_hasher (s, u) & m_vw->runtime_state . parse_mask ;
128
128
129
129
#ifdef _DEBUG
130
130
auto oldHash = HashFeatureNative (s, u);
@@ -321,7 +321,7 @@ List<VowpalWabbitExample^>^ VowpalWabbit::ParseDecisionServiceJson(cli::array<By
321
321
322
322
VW::parsers::json::decision_service_interaction interaction;
323
323
324
- if (m_vw->audit )
324
+ if (m_vw->output_config . audit )
325
325
VW::parsers::json::read_line_decision_service_json<true >(*m_vw, examples, reinterpret_cast <char *>(data), length, copyJson, std::bind (get_example_from_pool, &state), &interaction);
326
326
else
327
327
VW::parsers::json::read_line_decision_service_json<false >(*m_vw, examples, reinterpret_cast <char *>(data), length, copyJson, std::bind (get_example_from_pool, &state), &interaction);
@@ -385,7 +385,7 @@ List<VowpalWabbitExample^>^ VowpalWabbit::ParseDecisionServiceJson(cli::array<By
385
385
386
386
interior_ptr<ParseJsonState^> state_ptr = &state;
387
387
388
- if (m_vw->audit )
388
+ if (m_vw->output_config . audit )
389
389
VW::parsers::json::read_line_json<true >(*m_vw, examples, reinterpret_cast <char *>(valueHandle.AddrOfPinnedObject ().ToPointer ()), (size_t )bytes->Length , std::bind (get_example_from_pool, &state));
390
390
else
391
391
VW::parsers::json::read_line_json<false >(*m_vw, examples, reinterpret_cast <char *>(valueHandle.AddrOfPinnedObject ().ToPointer ()), (size_t )bytes->Length , std::bind (get_example_from_pool, &state));
@@ -793,15 +793,15 @@ VowpalWabbitExample^ VowpalWabbit::GetOrCreateNativeExample()
793
793
{ try
794
794
{
795
795
auto ex = new VW::example;
796
- m_vw->example_parser ->lbl_parser .default_label (ex->l );
796
+ m_vw->parser_runtime . example_parser ->lbl_parser .default_label (ex->l );
797
797
return gcnew VowpalWabbitExample (this , ex);
798
798
}
799
799
CATCHRETHROW
800
800
}
801
801
802
802
try
803
803
{ VW::empty_example (*m_vw, *ex->m_example );
804
- m_vw->example_parser ->lbl_parser .default_label (ex->m_example ->l );
804
+ m_vw->parser_runtime . example_parser ->lbl_parser .default_label (ex->m_example ->l );
805
805
806
806
return ex;
807
807
}
@@ -833,9 +833,9 @@ void VowpalWabbit::ReturnExampleToPool(VowpalWabbitExample^ ex)
833
833
}
834
834
835
835
cli::array<List<VowpalWabbitFeature^>^>^ VowpalWabbit::GetTopicAllocation(int top)
836
- { uint64_t length = (uint64_t )1 << m_vw->num_bits ;
836
+ { uint64_t length = (uint64_t )1 << m_vw->initial_weights_config . num_bits ;
837
837
// using jagged array to enable LINQ
838
- auto K = (int )m_vw->lda ;
838
+ auto K = (int )m_vw->reduction_state . lda ;
839
839
auto allocation = gcnew cli::array<List<VowpalWabbitFeature^>^>(K);
840
840
841
841
// TODO: better way of peaking into lda?
@@ -858,10 +858,10 @@ cli::array<List<VowpalWabbitFeature^>^>^ VowpalWabbit::GetTopicAllocation(int to
858
858
template <typename T>
859
859
cli::array<cli::array<float >^>^ VowpalWabbit::FillTopicAllocation(T& weights)
860
860
{
861
- uint64_t length = (uint64_t )1 << m_vw->num_bits ;
861
+ uint64_t length = (uint64_t )1 << m_vw->initial_weights_config . num_bits ;
862
862
863
863
// using jagged array to enable LINQ
864
- auto K = (int )m_vw->lda ;
864
+ auto K = (int )m_vw->reduction_state . lda ;
865
865
auto allocation = gcnew cli::array<cli::array<float >^>(K);
866
866
for (int k = 0 ; k < K; k++)
867
867
allocation[k] = gcnew cli::array<float >((int )length);
0 commit comments