featurizer_function not using its arg
Hi Gandhi,
I am a student that is trying to learn IRL and I am taking your program as example. I found the function in this .ipynb has a function featurizer_function( ) that is not using its argument featureVecDim. Would you please clarify if it is still being used and where should it be placed.
Thank you
Hi,
You pointed it out correctly. Initially, the feature vector dimension was used in deciding the number of RBF kernels to be used, which decides the feature vector dimension. The code used to look like the following:
featurizer_vector = sklearn.pipeline.FeatureUnion([
("rbf1",RBFSampler(gamma=0.5,n_components=featureVecDim)),
])
After some analysis, I found out that a collection of RBF kernels with a varying gamma value performs better. So, to account for that, the code changed to:
featurizer_vector = sklearn.pipeline.FeatureUnion([
("rbf1",RBFSampler(gamma=0.5,n_components=10)),
("rbf2", RBFSampler(gamma=0.25, n_components=20)),
("rbf3", RBFSampler(gamma=0.1, n_components=20))
])
So, the feature vector generated will have a dimension of 50 (10+20+20). And currently, the arg featureVectorDim is not used in that function.
Ah, I see. Thanks for pointing out!
Besides, the RBFSamplers are using different gamma, as well as the number of components. Is there any particular reason for such a design?