How to use cross-validation method in Tensor-Flow

675 Views Asked by At

I'm trying to use cross-validation in Tensor-flow . i write this semi code as my algorithm

Database{
    Class1=12000
    Class2=20000
}
TrainBatch=
{
    Class1=11000
    Class2=18000
}
TestBatch=
{
    Class1=1000
    Class2=2000
}
epoch=5000
while(Epoch>0)
{
    K=10
    Shufle(TrainBatch);
    Devide TrainBatch To 10 Batch For Cross Validation;
    for (i=1;i=k;i++)
    {
        V=Fetch (ValidateBatch[i]);
        T=Fetch (TrainBatch-V);
        Y=TrainWithTensorflow(T);
        Validate(Y,V);
        SaveDetail();
    }
    Epoch--;
}

Final Test(Class1=1000,Class2=2000);

but i don't know how to combine Cross-validation and tensor-flow training parameters in one algorithm.

is method is correct ? or can anyone correct this method ?

0

There are 0 best solutions below