Magic

Experiment with any imaginable function using our Magic Object

Instantiate Magic Object before use.

mj = MagicObj()

get_path

get_path(filename, path)

Search the data by filename from path , if exist, return the data path.

Example:

data_path = mj.get_path(
                filename = "boston_housing.csv",
                path = "/home/project/workspace/dataset")
data = pd.read_csv(data_path)

log

log(**kwargs)

Log metrics then you can choose one as optimal standard.

Do not use log within a Trainable class.

Example:

mj.log(loss=running_loss, eval_loss=eval_loss)

so u can read the data with that save ur checkpoints no matter what framework api for every single framework log you metrics

torch_get_checkpoint_path

torch_get_checkpoint_path(path, epoch)

Return the path of checkpoints during each epoch or whenever you want.

Example:

mj.torch_get_checkpoint_path(path='/home/project/workspace/results', epoch=epoch)

torch_save

torch_save(checkpoint, path, epoch)

Save checkpoint during each epoch.

Example:

mj.torch_save(
    checkpoint = model.state_dict(),
    path = '/home/project/workspace/results',
    epoch = epoch)

tensor_save

tensor_save(checkpoint, path)

Save checkpoint whenever you want.

Example:

mj.tensor_save(checkpoint=model, path='/home/project/workspace/results')

callback

callback(metrics, path, frequency, on, filename=None)

Save checkpoint with the opportunity by on during each epoch and s

Example:

model.fit(
	X_train, Y_train,
	initial_epoch=1, epochs=epochs, batch_size=16, verbose=0,
	callbacks=[m.callback(
		metrics={"accuracy":"accuracy"},
		filename="modelcheckpoint01",
		path="/home/pj/ray_results",
		frequency=1,
		on="epoch_end")]
		)

Last updated