Skip to content
Snippets Groups Projects

Unsupervised learning

Merged Vicentini Filippo requested to merge github/fork/GTorlai/master into v2.0

Created by: GTorlai

This is to fix issue #5 (closed)

See tutorial in Tutorial/QuantumStateReconstruction/ for reconstructing the wavefunction of the quantum Ising model from raw measurement data.

Merge request reports

Merged by avatar (Apr 16, 2025 5:19am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Vicentini Filippo
  • 244 }
    245
    246 void Run() {
    247 std::vector<Eigen::VectorXd> batchSamples;
    248 std::vector<int> batchBases;
    249 opt_.Reset();
    250
    251 InitSweeps();
    252 std::uniform_int_distribution<int> distribution(
    253 0, trainingSamples_.size() - 1);
    254
    255 for (int i = 0; i < niter_opt_; i++) {
    256 int index;
    257 batchSamples.resize(batchsize_node_);
    258 batchBases.resize(batchsize_node_);
    259
  • 264 }
    265 Gradient(batchSamples, batchBases);
    266 UpdateParameters();
    267 PrintOutput(i);
    268 }
    269 }
    270
    271 void UpdateParameters() {
    272 auto pars = psi_.GetParameters();
    273 opt_.Update(grad_, pars);
    274 SendToAll(pars);
    275 psi_.SetParameters(pars);
    276 MPI_Barrier(MPI_COMM_WORLD);
    277 }
    278
    279 void RotateGradient(int b_index, const Eigen::VectorXd &state,
  • Vicentini Filippo
  • Created by: gcarleo

    Review: Commented

    Thanks @GTorlai , almost there ;) Just a few leftovers in the code I found

  • Created by: gcarleo

    Review: Approved

    OK great!

  • Merged by: gcarleo at 2018-12-14 15:29:36 UTC

  • Please register or sign in to reply
    Loading