// create a segment learning pipeline
width = 100
est = KerasClassifier(build_fn=crnn_model, epochs = 10, batch_size = 256, verbose = 0, validation_split = 0.2)
pipe = SegPipe(est)
////////////////////////////////////////////////////////////////////////////////////////////
// Accessing training history
////////////////////////////////////////////////////////////////////////////////////////////
// this is a bit of a hack, because history object is returned by the
// keras wrapper when fit is called
// this approach won"t work with a more complex estimator pipeline, in which case
// a callable class with the desired properties should be made passed to build_fn
pipe.fit(X_train,y_train)
print(DataFrame(pipe.history.history))
ac_train = pipe.history.history["acc"]
ac_val = pipe.history.history["val_acc"]
epoch = np.arange(len(ac_train))+1
////////////////////////////////////////////////////////////////////////////////////////////
After Change
// create a segment learning pipeline
width = 100
pipe = Pype([("seg",SegmentX()),
("crnn", KerasClassifier(build_fn=crnn_model, epochs = 10, batch_size = 256,
verbose = 0, validation_split = 0.2))])
////////////////////////////////////////////////////////////////////////////////////////////
// Accessing training history
////////////////////////////////////////////////////////////////////////////////////////////
// this is a bit of a hack, because history object is returned by the
// keras wrapper when fit is called
// this approach won"t work with a more complex estimator pipeline, in which case
// a callable class with the desired properties should be made passed to build_fn
pipe.fit(X_train,y_train)
print(DataFrame(pipe.history.history))
ac_train = pipe.history.history["acc"]
ac_val = pipe.history.history["val_acc"]
epoch = np.arange(len(ac_train))+1
////////////////////////////////////////////////////////////////////////////////////////////