dlpy.lr_scheduler.CyclicLR

class dlpy.lr_scheduler.CyclicLR(conn, data, batch_size, factor, learning_rate, max_lr)

Bases: dlpy.lr_scheduler.FCMPLR

Cyclic learning rate scheduler The policy cycles the learning rate between two boundaries[learning_rate, max_lr] with a constant frequency which can be adjusted by factor. The learning rate changes after every batch. batch_size and data are necessary to determine how many batches an epoch requires. Example:

lr_scheduler = CyclicLR(conn=sess, data=my_images, max_lr=0.01, batch_size=1, factor=2,
learning_rate=0.0001)

solver = MomentumSolver(lr_scheduler = lr_scheduler, clip_grad_max = 100, clip_grad_min = -100)

Parameters:
conn : CAS

Specifies the CAS connection object.

data : string or CASTable

Specifies the data for training.

batch_size : int

Specifies the batch size equal to product of mini_batch_size, n_threads and number of workers.

factor : int

Specifies the number of epochs within one half of a cycle length

learning_rate : double

Specifies the initial learning rate that is smaller than max_lr.

max_lr : double

Specifies the highest learning rate.

Returns:
CyclicLR

References

https://arxiv.org/pdf/1506.01186.pdf

__init__(conn, data, batch_size, factor, learning_rate, max_lr)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(conn, data, batch_size, factor, …) Initialize self.
clear()
get(k[,d])
items()
keys()
pop(k[,d]) If key is not found, d is returned if given, otherwise KeyError is raised.
popitem() as a 2-tuple; but raise KeyError if D is empty.
setdefault(k[,d])
update([E, ]**F) If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values()