Hi Andre
There are no pre-trained neural nets (and no convolutional neural nets 
at all) in scikit-learn.
Check out sklearn-theano, nolearn or keras.

The knn is pretty straight-forward from the docs.

Cheers,
Andy

On 04/05/2016 10:54 AM, André Cruz wrote:
> Hello all.
>
> I've been using GraphLab while doing a machine learning specialization in 
> Coursera (https://www.coursera.org/specializations/machine-learning). 
> However, I would also like to try scikit-learn for comparison and maybe use 
> it since it is open source. Could someone look at this GraphLab snippet and 
> help me convert it to scikit-learn? Basically I'm loading the AlexNet model 
> pre-trained on the imagenet dataset, extracting features from images stored 
> locally, and then using k-nearest neighbour to find similar images based on 
> some queries:
>
>
> -------------
> import graphlab
>
> # build model
> image_data = graphlab.image_analysis.load_images('images/') # load images 
> from dir
> deep_learning_model = 
> graphlab.load_model('http://s3.amazonaws.com/GraphLab-Datasets/deeplearning/imagenet_model_iter45')
>  # load trained imagenet model
> image_data['deep_features'] = deep_learning_model.extract_features(image_data)
> knn_model = 
> graphlab.nearest_neighbors.create(image_data,features=['deep_features'])
>
> # query model
> query_sframe = graphlab.image_analysis.load_images('query')
> query_sframe['deep_features'] = 
> deep_learning_model.extract_features(query_sframe)
> results = knn_model.query(query_frame)
> -------------
>
> Thanks for the help and best regards,
> André Cruz
> ------------------------------------------------------------------------------
> _______________________________________________
> Scikit-learn-general mailing list
> Scikit-learn-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general


------------------------------------------------------------------------------
_______________________________________________
Scikit-learn-general mailing list
Scikit-learn-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to