Class: CNTK::TrainingSession

Inherits:
Object
  • Object
show all
Defined in:
ext/cntk/cntk_wrap.cxx

Instance Method Summary collapse

Constructor Details

#initialize(*args, self) ⇒ Object



65338
65339
65340
65341
65342
65343
65344
65345
65346
65347
65348
65349
65350
65351
65352
65353
65354
65355
65356
65357
65358
65359
65360
65361
65362
65363
65364
65365
65366
65367
65368
65369
65370
65371
65372
65373
65374
65375
65376
65377
65378
65379
65380
65381
65382
65383
65384
65385
65386
65387
65388
65389
65390
65391
65392
65393
65394
65395
65396
65397
65398
65399
65400
65401
65402
65403
65404
65405
65406
65407
65408
65409
65410
65411
65412
65413
65414
65415
65416
65417
65418
65419
65420
65421
65422
65423
65424
65425
65426
65427
65428
65429
65430
65431
65432
65433
65434
65435
65436
65437
65438
65439
65440
65441
65442
65443
65444
65445
65446
65447
65448
65449
65450
65451
65452
65453
65454
65455
65456
65457
65458
65459
65460
65461
65462
65463
65464
65465
65466
65467
65468
65469
65470
65471
65472
65473
65474
65475
65476
65477
65478
65479
65480
65481
65482
65483
65484
65485
65486
65487
65488
65489
65490
65491
65492
65493
65494
65495
65496
65497
65498
65499
65500
65501
65502
65503
65504
65505
65506
65507
65508
65509
65510
65511
65512
65513
65514
65515
65516
65517
65518
65519
65520
65521
65522
65523
65524
65525
65526
65527
65528
65529
65530
65531
65532
65533
65534
65535
65536
65537
65538
65539
65540
65541
65542
65543
65544
65545
65546
65547
65548
65549
65550
65551
65552
65553
65554
65555
65556
65557
65558
65559
65560
65561
65562
65563
65564
65565
65566
65567
65568
65569
65570
65571
65572
65573
65574
65575
65576
65577
65578
65579
65580
65581
65582
65583
65584
65585
65586
65587
65588
65589
65590
65591
65592
65593
65594
65595
65596
65597
65598
65599
65600
65601
65602
65603
65604
65605
65606
65607
65608
65609
65610
65611
65612
65613
65614
65615
65616
65617
65618
65619
65620
65621
65622
65623
65624
65625
65626
65627
65628
65629
65630
65631
65632
65633
65634
65635
65636
65637
65638
65639
65640
65641
65642
65643
65644
65645
65646
65647
65648
65649
65650
65651
65652
65653
65654
65655
65656
65657
65658
65659
65660
65661
65662
65663
65664
65665
65666
65667
65668
65669
65670
65671
65672
65673
65674
65675
65676
65677
65678
65679
65680
65681
65682
65683
65684
65685
65686
65687
65688
65689
65690
65691
65692
65693
65694
65695
65696
65697
65698
65699
65700
65701
65702
65703
65704
65705
65706
65707
65708
65709
65710
65711
65712
65713
65714
65715
65716
65717
65718
65719
65720
65721
65722
65723
65724
65725
65726
65727
65728
65729
65730
65731
65732
65733
65734
65735
65736
65737
65738
65739
65740
65741
65742
65743
65744
65745
65746
65747
65748
65749
65750
65751
65752
65753
65754
65755
65756
65757
65758
65759
65760
65761
65762
65763
65764
65765
# File 'ext/cntk/cntk_wrap.cxx', line 65338

SWIGINTERN VALUE _wrap_new_TrainingSession(int nargs, VALUE *args, VALUE self) {
  int argc;
  VALUE argv[13];
  int ii;
  
  argc = nargs;
  if (argc > 13) SWIG_fail;
  for (ii = 0; (ii < argc); ++ii) {
    argv[ii] = args[ii];
  }
  if (argc == 6) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                return _wrap_new_TrainingSession__SWIG_7(nargs, args, self);
              }
            }
          }
        }
      }
    }
  }
  if (argc == 7) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  return _wrap_new_TrainingSession__SWIG_6(nargs, args, self);
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 8) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  void *vptr = 0;
                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    return _wrap_new_TrainingSession__SWIG_5(nargs, args, self);
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 9) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  void *vptr = 0;
                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    {
                      int res = SWIG_AsVal_size_t(argv[8], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      return _wrap_new_TrainingSession__SWIG_4(nargs, args, self);
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 10) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  void *vptr = 0;
                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    {
                      int res = SWIG_AsVal_size_t(argv[8], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      {
                        int res = SWIG_AsVal_bool(argv[9], NULL);
                        _v = SWIG_CheckState(res);
                      }
                      if (_v) {
                        return _wrap_new_TrainingSession__SWIG_3(nargs, args, self);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 11) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  void *vptr = 0;
                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    {
                      int res = SWIG_AsVal_size_t(argv[8], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      {
                        int res = SWIG_AsVal_bool(argv[9], NULL);
                        _v = SWIG_CheckState(res);
                      }
                      if (_v) {
                        {
                          int res = SWIG_AsVal_bool(argv[10], NULL);
                          _v = SWIG_CheckState(res);
                        }
                        if (_v) {
                          return _wrap_new_TrainingSession__SWIG_2(nargs, args, self);
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 12) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  void *vptr = 0;
                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    {
                      int res = SWIG_AsVal_size_t(argv[8], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      {
                        int res = SWIG_AsVal_bool(argv[9], NULL);
                        _v = SWIG_CheckState(res);
                      }
                      if (_v) {
                        {
                          int res = SWIG_AsVal_bool(argv[10], NULL);
                          _v = SWIG_CheckState(res);
                        }
                        if (_v) {
                          {
                            int res = SWIG_AsVal_size_t(argv[11], NULL);
                            _v = SWIG_CheckState(res);
                          }
                          if (_v) {
                            return _wrap_new_TrainingSession__SWIG_1(nargs, args, self);
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (argc == 13) {
    int _v;
    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
    _v = SWIG_CheckState(res);
    if (_v) {
      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__Trainer_t, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__unordered_mapT_CNTK__Variable_CNTK__StreamInformation_std__hashT_CNTK__Variable_t_std__equal_toT_CNTK__Variable_t_std__allocatorT_std__pairT_CNTK__Variable_const_CNTK__StreamInformation_t_t_t, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          void *vptr = 0;
          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            {
              int res = SWIG_AsVal_size_t(argv[4], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              int res = SWIG_AsPtr_std_wstring(argv[5], (std::wstring**)(0));
              _v = SWIG_CheckState(res);
              if (_v) {
                int res = SWIG_ConvertPtr(argv[6], 0, SWIGTYPE_p_std__shared_ptrT_CNTK__MinibatchSource_t, 0);
                _v = SWIG_CheckState(res);
                if (_v) {
                  void *vptr = 0;
                  int res = SWIG_ConvertPtr(argv[7], &vptr, SWIGTYPE_p_CNTK__TrainingParameterPerUnitScheduleT_size_t_CNTK__TrainingParameterScheduleT_size_t_t__UnitType__Sample_t, 0);
                  _v = SWIG_CheckState(res);
                  if (_v) {
                    {
                      int res = SWIG_AsVal_size_t(argv[8], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      {
                        int res = SWIG_AsVal_bool(argv[9], NULL);
                        _v = SWIG_CheckState(res);
                      }
                      if (_v) {
                        {
                          int res = SWIG_AsVal_bool(argv[10], NULL);
                          _v = SWIG_CheckState(res);
                        }
                        if (_v) {
                          {
                            int res = SWIG_AsVal_size_t(argv[11], NULL);
                            _v = SWIG_CheckState(res);
                          }
                          if (_v) {
                            {
                              int res = SWIG_AsVal_size_t(argv[12], NULL);
                              _v = SWIG_CheckState(res);
                            }
                            if (_v) {
                              return _wrap_new_TrainingSession__SWIG_0(nargs, args, self);
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  
fail:
  Ruby_Format_OverloadedError( argc, 13, "TrainingSession.new", 
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource, CNTK::MinibatchSizeSchedule const &crossValidationSchedule, size_t crossValidationFrequencyInSamples, bool restoreFromCheckpointIfExists, bool keepExistingCheckpoints, size_t maxNumberOfTrainingSamples, size_t progressFrequency)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource, CNTK::MinibatchSizeSchedule const &crossValidationSchedule, size_t crossValidationFrequencyInSamples, bool restoreFromCheckpointIfExists, bool keepExistingCheckpoints, size_t maxNumberOfTrainingSamples)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource, CNTK::MinibatchSizeSchedule const &crossValidationSchedule, size_t crossValidationFrequencyInSamples, bool restoreFromCheckpointIfExists, bool keepExistingCheckpoints)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource, CNTK::MinibatchSizeSchedule const &crossValidationSchedule, size_t crossValidationFrequencyInSamples, bool restoreFromCheckpointIfExists)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource, CNTK::MinibatchSizeSchedule const &crossValidationSchedule, size_t crossValidationFrequencyInSamples)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource, CNTK::MinibatchSizeSchedule const &crossValidationSchedule)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName, CNTK::MinibatchSourcePtr const &crossValidationSource)\n"
    "    TrainingSession.new(CNTK::MinibatchSourcePtr const &trainingSource, CNTK::TrainerPtr const &trainer, std::unordered_map< CNTK::Variable,CNTK::StreamInformation,std::hash< CNTK::Variable >,std::equal_to< CNTK::Variable >,std::allocator< std::pair< CNTK::Variable const,CNTK::StreamInformation > > > const &modelInputToMinibatchSourceStream, CNTK::MinibatchSizeSchedule const &minibatchSizeSchedule, size_t checkpointFrequencyInSamples, std::wstring const &checkPointFileName)\n");
  
  return Qnil;
}

Instance Method Details

#get_minibatch_size(*args) ⇒ Object



65903
65904
65905
65906
65907
65908
65909
65910
65911
65912
65913
65914
65915
65916
65917
65918
65919
65920
65921
65922
65923
65924
65925
65926
65927
65928
65929
65930
65931
65932
65933
65934
65935
65936
65937
65938
65939
65940
65941
65942
65943
65944
65945
65946
65947
65948
65949
65950
65951
65952
65953
65954
# File 'ext/cntk/cntk_wrap.cxx', line 65903

SWIGINTERN VALUE
_wrap_TrainingSession_get_minibatch_size(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  size_t result;
  VALUE vresult = Qnil;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","GetMinibatchSize", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    try {
      result = (arg1)->GetMinibatchSize(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  vresult = SWIG_From_size_t(static_cast< size_t >(result));
  return vresult;
fail:
  return Qnil;
}

#on_checkpoint_end(*args) ⇒ Object



66118
66119
66120
66121
66122
66123
66124
66125
66126
66127
66128
66129
66130
66131
66132
66133
66134
66135
66136
66137
66138
66139
66140
66141
66142
66143
66144
66145
66146
66147
66148
66149
66150
66151
66152
66153
66154
66155
66156
66157
66158
66159
66160
66161
66162
66163
66164
66165
66166
66167
66168
66169
66170
66171
66172
66173
66174
# File 'ext/cntk/cntk_wrap.cxx', line 66118

SWIGINTERN VALUE
_wrap_TrainingSession_on_checkpoint_end(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","OnCheckpointEnd", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","OnCheckpointEnd", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      (arg1)->OnCheckpointEnd(arg2); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#on_checkpoint_start(*args) ⇒ Object



66059
66060
66061
66062
66063
66064
66065
66066
66067
66068
66069
66070
66071
66072
66073
66074
66075
66076
66077
66078
66079
66080
66081
66082
66083
66084
66085
66086
66087
66088
66089
66090
66091
66092
66093
66094
66095
66096
66097
66098
66099
66100
66101
66102
66103
66104
66105
66106
66107
66108
66109
66110
66111
66112
66113
66114
66115
# File 'ext/cntk/cntk_wrap.cxx', line 66059

SWIGINTERN VALUE
_wrap_TrainingSession_on_checkpoint_start(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","OnCheckpointStart", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","OnCheckpointStart", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      (arg1)->OnCheckpointStart(arg2); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#on_cross_validation_end(*args) ⇒ Object



66236
66237
66238
66239
66240
66241
66242
66243
66244
66245
66246
66247
66248
66249
66250
66251
66252
66253
66254
66255
66256
66257
66258
66259
66260
66261
66262
66263
66264
66265
66266
66267
66268
66269
66270
66271
66272
66273
66274
66275
66276
66277
66278
66279
66280
66281
66282
66283
66284
66285
66286
66287
66288
66289
66290
66291
66292
66293
66294
66295
66296
66297
66298
66299
66300
66301
66302
66303
66304
66305
66306
66307
66308
66309
66310
66311
66312
66313
66314
66315
66316
# File 'ext/cntk/cntk_wrap.cxx', line 66236

SWIGINTERN VALUE
_wrap_TrainingSession_on_cross_validation_end(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  size_t arg2 ;
  double arg3 ;
  size_t arg4 ;
  size_t arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  double val3 ;
  int ecode3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  size_t val5 ;
  int ecode5 = 0 ;
  
  if ((argc < 4) || (argc > 4)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","OnCrossValidationEnd", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","OnCrossValidationEnd", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  ecode3 = SWIG_AsVal_double(argv[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","OnCrossValidationEnd", 3, argv[1] ));
  } 
  arg3 = static_cast< double >(val3);
  ecode4 = SWIG_AsVal_size_t(argv[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "size_t","OnCrossValidationEnd", 4, argv[2] ));
  } 
  arg4 = static_cast< size_t >(val4);
  ecode5 = SWIG_AsVal_size_t(argv[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "size_t","OnCrossValidationEnd", 5, argv[3] ));
  } 
  arg5 = static_cast< size_t >(val5);
  {
    try {
      (arg1)->OnCrossValidationEnd(arg2,arg3,arg4,arg5); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#on_cross_validation_start(*args) ⇒ Object



66177
66178
66179
66180
66181
66182
66183
66184
66185
66186
66187
66188
66189
66190
66191
66192
66193
66194
66195
66196
66197
66198
66199
66200
66201
66202
66203
66204
66205
66206
66207
66208
66209
66210
66211
66212
66213
66214
66215
66216
66217
66218
66219
66220
66221
66222
66223
66224
66225
66226
66227
66228
66229
66230
66231
66232
66233
# File 'ext/cntk/cntk_wrap.cxx', line 66177

SWIGINTERN VALUE
_wrap_TrainingSession_on_cross_validation_start(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  size_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","OnCrossValidationStart", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","OnCrossValidationStart", 2, argv[0] ));
  } 
  arg2 = static_cast< size_t >(val2);
  {
    try {
      (arg1)->OnCrossValidationStart(arg2); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#on_minibatch_end(*args) ⇒ Object



66008
66009
66010
66011
66012
66013
66014
66015
66016
66017
66018
66019
66020
66021
66022
66023
66024
66025
66026
66027
66028
66029
66030
66031
66032
66033
66034
66035
66036
66037
66038
66039
66040
66041
66042
66043
66044
66045
66046
66047
66048
66049
66050
66051
66052
66053
66054
66055
66056
# File 'ext/cntk/cntk_wrap.cxx', line 66008

SWIGINTERN VALUE
_wrap_TrainingSession_on_minibatch_end(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","OnMinibatchEnd", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    try {
      (arg1)->OnMinibatchEnd(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#on_minibatch_start(*args) ⇒ Object



65957
65958
65959
65960
65961
65962
65963
65964
65965
65966
65967
65968
65969
65970
65971
65972
65973
65974
65975
65976
65977
65978
65979
65980
65981
65982
65983
65984
65985
65986
65987
65988
65989
65990
65991
65992
65993
65994
65995
65996
65997
65998
65999
66000
66001
66002
66003
66004
66005
# File 'ext/cntk/cntk_wrap.cxx', line 65957

SWIGINTERN VALUE
_wrap_TrainingSession_on_minibatch_start(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  
  if ((argc < 0) || (argc > 0)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","OnMinibatchStart", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    try {
      (arg1)->OnMinibatchStart(); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}

#restore_from_checkpoint(*args) ⇒ Object



65830
65831
65832
65833
65834
65835
65836
65837
65838
65839
65840
65841
65842
65843
65844
65845
65846
65847
65848
65849
65850
65851
65852
65853
65854
65855
65856
65857
65858
65859
65860
65861
65862
65863
65864
65865
65866
65867
65868
65869
65870
65871
65872
65873
65874
65875
65876
65877
65878
65879
65880
65881
65882
65883
65884
65885
65886
65887
65888
65889
65890
65891
65892
65893
# File 'ext/cntk/cntk_wrap.cxx', line 65830

SWIGINTERN VALUE
_wrap_TrainingSession_restore_from_checkpoint(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  std::wstring *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  int res2 = SWIG_OLDOBJ ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","RestoreFromCheckpoint", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  {
    std::wstring *ptr = (std::wstring *)0;
    res2 = SWIG_AsPtr_std_wstring(argv[0], &ptr);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::wstring const &","RestoreFromCheckpoint", 2, argv[0] )); 
    }
    if (!ptr) {
      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::wstring const &","RestoreFromCheckpoint", 2, argv[0])); 
    }
    arg2 = ptr;
  }
  {
    try {
      (arg1)->RestoreFromCheckpoint((std::wstring const &)*arg2); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
fail:
  if (SWIG_IsNewObj(res2)) delete arg2;
  return Qnil;
}

#train(*args) ⇒ Object



65768
65769
65770
65771
65772
65773
65774
65775
65776
65777
65778
65779
65780
65781
65782
65783
65784
65785
65786
65787
65788
65789
65790
65791
65792
65793
65794
65795
65796
65797
65798
65799
65800
65801
65802
65803
65804
65805
65806
65807
65808
65809
65810
65811
65812
65813
65814
65815
65816
65817
65818
65819
65820
65821
65822
65823
65824
65825
65826
65827
# File 'ext/cntk/cntk_wrap.cxx', line 65768

SWIGINTERN VALUE
_wrap_TrainingSession_train(int argc, VALUE *argv, VALUE self) {
  CNTK::TrainingSession *arg1 = (CNTK::TrainingSession *) 0 ;
  CNTK::DeviceDescriptor *arg2 = 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  std::shared_ptr< CNTK::TrainingSession > tempshared1 ;
  std::shared_ptr< CNTK::TrainingSession > *smartarg1 = 0 ;
  void *argp2 ;
  int res2 = 0 ;
  
  if ((argc < 1) || (argc > 1)) {
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
  }
  {
    swig_ruby_owntype newmem = {
      0, 0
    };
    res1 = SWIG_ConvertPtrAndOwn(self, &argp1, SWIGTYPE_p_std__shared_ptrT_CNTK__TrainingSession_t, 0 |  0 , &newmem);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CNTK::TrainingSession *","Train", 1, self ));
    }
    if (newmem.own & SWIG_CAST_NEW_MEMORY) {
      tempshared1 = *reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      delete reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >(tempshared1.get());
    } else {
      smartarg1 = reinterpret_cast< std::shared_ptr<  CNTK::TrainingSession > * >(argp1);
      arg1 = const_cast< CNTK::TrainingSession * >((smartarg1 ? smartarg1->get() : 0));
    }
  }
  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_CNTK__DeviceDescriptor,  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "CNTK::DeviceDescriptor const &","Train", 2, argv[0] )); 
  }
  if (!argp2) {
    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "CNTK::DeviceDescriptor const &","Train", 2, argv[0])); 
  }
  arg2 = reinterpret_cast< CNTK::DeviceDescriptor * >(argp2);
  {
    try {
      (arg1)->Train((CNTK::DeviceDescriptor const &)*arg2); 
    }
    catch (const std::runtime_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (const std::invalid_argument &e) {
      SWIG_exception(SWIG_ValueError,e.what()); 
    }
    catch (const std::logic_error &e) {
      SWIG_exception(SWIG_RuntimeError,e.what()); 
    }
    catch (...) {
      SWIG_exception(SWIG_UnknownError,"Runtime exception"); 
    }
  }
  return Qnil;
fail:
  return Qnil;
}