How to use the poutyne.framework.callbacks.policies.sgdr_phases function in Poutyne

To help you get started, we’ve selected a few Poutyne examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GRAAL-Research / poutyne / tests / framework / callbacks / test_policies.py View on Github external
def test_length_with_higher_cycle_mult(self):
        policy = OptimizerPolicy(sgdr_phases(10, 1, cycle_mult=2))
        self.assertEqual(len(list(policy.all_steps())), 10)

        policy = OptimizerPolicy(sgdr_phases(10, 2, cycle_mult=2))
        self.assertEqual(len(list(policy.all_steps())), 30)

        policy = OptimizerPolicy(sgdr_phases(10, 3, cycle_mult=2))
        self.assertEqual(len(list(policy.all_steps())), 70)

        policy = OptimizerPolicy(sgdr_phases(10, 1, cycle_mult=3))
        self.assertEqual(len(list(policy.all_steps())), 10)

        policy = OptimizerPolicy(sgdr_phases(10, 2, cycle_mult=3))
        self.assertEqual(len(list(policy.all_steps())), 40)
github GRAAL-Research / poutyne / tests / framework / callbacks / test_policies.py View on Github external
def test_length_with_higher_cycle_mult(self):
        policy = OptimizerPolicy(sgdr_phases(10, 1, cycle_mult=2))
        self.assertEqual(len(list(policy.all_steps())), 10)

        policy = OptimizerPolicy(sgdr_phases(10, 2, cycle_mult=2))
        self.assertEqual(len(list(policy.all_steps())), 30)

        policy = OptimizerPolicy(sgdr_phases(10, 3, cycle_mult=2))
        self.assertEqual(len(list(policy.all_steps())), 70)

        policy = OptimizerPolicy(sgdr_phases(10, 1, cycle_mult=3))
        self.assertEqual(len(list(policy.all_steps())), 10)

        policy = OptimizerPolicy(sgdr_phases(10, 2, cycle_mult=3))
        self.assertEqual(len(list(policy.all_steps())), 40)
github GRAAL-Research / poutyne / tests / framework / callbacks / test_policies.py View on Github external
def test_length_with_cycle_mult_one(self):
        policy = OptimizerPolicy(sgdr_phases(10, 1, cycle_mult=1))
        self.assertEqual(len(list(policy.all_steps())), 10)

        policy = OptimizerPolicy(sgdr_phases(10, 2, cycle_mult=1))
        self.assertEqual(len(list(policy.all_steps())), 20)

        policy = OptimizerPolicy(sgdr_phases(10, 10, cycle_mult=1))
        self.assertEqual(len(list(policy.all_steps())), 100)
github GRAAL-Research / poutyne / tests / framework / callbacks / test_policies.py View on Github external
def test_length_with_cycle_mult_one(self):
        policy = OptimizerPolicy(sgdr_phases(10, 1, cycle_mult=1))
        self.assertEqual(len(list(policy.all_steps())), 10)

        policy = OptimizerPolicy(sgdr_phases(10, 2, cycle_mult=1))
        self.assertEqual(len(list(policy.all_steps())), 20)

        policy = OptimizerPolicy(sgdr_phases(10, 10, cycle_mult=1))
        self.assertEqual(len(list(policy.all_steps())), 100)