Linear-Inverse-RL-algorithms icon indicating copy to clipboard operation
Linear-Inverse-RL-algorithms copied to clipboard

featurizer_function not using its arg

Open hmf0103 opened this issue 5 years ago • 3 comments

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

hmf0103 avatar Feb 17 '20 03:02 hmf0103

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.

vjg28 avatar Nov 28 '20 10:11 vjg28

Ah, I see. Thanks for pointing out!

hmf0103 avatar Dec 09 '20 05:12 hmf0103

Besides, the RBFSamplers are using different gamma, as well as the number of components. Is there any particular reason for such a design?

hmf0103 avatar Jan 03 '21 20:01 hmf0103