@@ -709,39 +709,6 @@ namespace btas {
709709 normCol (i);
710710 }
711711 }
712- // else{
713- /* for(size_t i = 0; i < this->ndim; ++i) {
714- auto &a_prev = this->A[i];
715- ind_t col_dim = a_prev.extent(0);
716- ind_t prev_rank = a_prev.extent(1), smaller_rank = (prev_rank < rank ? prev_rank : rank),
717- larger_rank = (smaller_rank == prev_rank ? rank : prev_rank);
718- // If the new factor is bigger than the last add random cols
719- if (larger_rank > smaller_rank) {
720- Tensor a(col_dim, larger_rank);
721- for (auto iter = a.begin(); iter != a.end(); ++iter) {
722- *(iter) = distribution(generator);
723- }
724- auto lo_bound = {0l, 0l}, up_bound = {col_dim, smaller_rank};
725- auto view = make_view(a.range().slice(lo_bound, up_bound), a.storage());
726- // std::copy(view.begin(), view.end(), a_prev.begin());
727- auto old = a_prev.begin();
728- for (auto iter = view.begin(); iter != view.end(); ++iter, ++old) *(iter) += *(old);
729- a_prev = a;
730- }*/
731- // Optional add a bump to the previous factors
732- // } else{
733- // for(auto & el : a_prev)
734- // el += distribution(generator);
735- // }
736- // }
737- /* A.pop_back();
738- Tensor lambda(rank);
739- lambda.fill(0.0);
740- this->A.push_back(lambda);
741- for (size_t i = 0; i < ndim; ++i) {
742- normCol(i);
743- }*/
744- // }
745712 factors_set = true ;
746713 ALS (rank, converge_test, max_als, calculate_epsilon, epsilon, fast_pI);
747714 }
@@ -801,7 +768,7 @@ namespace btas {
801768 is_converged = converge_test (A, this ->AtA );
802769 if (count == 10 )
803770 close_to_end_factors = this ->A ;
804- }while (count < max_als && !is_converged);
771+ } while (count < max_als && !is_converged);
805772
806773 // Checks loss function if required
807774 detail::get_fit (converge_test, epsilon, (this ->num_ALS == max_als));
0 commit comments