id int64 0 25.6k | text stringlengths 0 4.59k |
|---|---|
15,400 | import matplotlib pyplot as plt import numpy as np nextwe will be plotting the datapoints we have taken for this examplex np array([[ , ],[ , ],[ , ],[ , ],[ , ],[ , ],[ , ][ , ],[ , ],[ , ],]labels range( plt figure(figsize=( )plt subplots_adjust(bottom= plt scatter( [:, ], [:, ]label='true position'for labelxy in zip... |
15,401 | dendrogram(linkedorientation='top',labels=labellistdistance_sort='descending',show_leaf_counts=trueplt show(nowonce the big cluster is formedthe longest vertical distance is selected vertical line is then drawn through it as shown in the following diagram as the horizontal line crosses the blue line at two pointsthe nu... |
15,402 | from sklearn cluster import agglomerativeclustering cluster agglomerativeclustering(n_clusters= affinity='euclidean'linkage='ward'cluster fit_predict(xnextplot the cluster with the help of following codeplt scatter( [:, ], [:, ] =cluster labels_cmap='rainbow'the above diagram shows the two clusters from our datapoints ... |
15,403 | array[:, data shape ( data head(preg plas pres skin test mass pedi age class patient_data data iloc[: : values import scipy cluster hierarchy as shc plt figure(figsize=( )plt title("patient dendograms"dend shc dendrogram(shc linkage(datamethod='ward') |
15,404 | from sklearn cluster import agglomerativeclustering cluster agglomerativeclustering(n_clusters= affinity='euclidean'linkage='ward'cluster fit_predict(patient_dataplt figure(figsize=( )plt scatter(patient_data[:, ]patient_data[:, ] =cluster labels_cmap='rainbow' |
15,405 | machine learning algorithms knn algorithm |
15,406 | knn algorithm finding nearest neighbors introduction -nearest neighbors (knnalgorithm is type of supervised ml algorithm which can be used for both classification as well as regression predictive problems howeverit is mainly used for classification predictive problems in industry the following two properties would defi... |
15,407 | nowwe need to classify new data point with black dot (at point , into blue or red class we are assuming it would find three nearest data points it is shown in the next diagramwe can see in the above diagram the three nearest neighbors of the data point with black dot among those threetwo of them lies in red class hence... |
15,408 | knn as classifier firststart with importing necessary python packagesimport numpy as np import matplotlib pyplot as plt import pandas as pd nextdownload the iris dataset from its weblink as followspath "nextwe need to assign column names to the dataset as followsheadernames ['sepal-length''sepal-width''petal-length''pe... |
15,409 | x_test scaler transform(x_testnexttrain the model with the help of kneighborsclassifier class of sklearn as followsfrom sklearn neighbors import kneighborsclassifier classifier kneighborsclassifier(n_neighbors= classifier fit(x_trainy_trainat last we need to make prediction it can be done with the help of following scr... |
15,410 | accuracy knn as regressor firststart with importing necessary python packagesimport numpy as np import pandas as pd nextdownload the iris dataset from its weblink as followspath "nextwe need to assign column names to the dataset as followsheadernames ['sepal-length''sepal-width''petal-length''petal-width''class'nowwe n... |
15,411 | pros and cons of knn pros it is very simple algorithm to understand and interpret it is very useful for nonlinear data because there is no assumption about data in this algorithm it is versatile algorithm as we can use it for classification as well as regression it has relatively high accuracy but there are much better... |
15,412 | machine learning algorithms -machine performance metrics there are various metrics which we can use to evaluate the performance of ml algorithmsclassification as well as regression algorithms we must carefully choose the metrics for evaluating ml performance becausehow the performance of ml algorithms is measured and c... |
15,413 | false negatives (fn)it is the case when actual class of data point is predicted class of data point is we can use confusion_matrix function of sklearn metrics to compute confusion matrix of our classification model classification accuracy it is most common performance metric for classification algorithms it may be defi... |
15,414 | support support may be defined as the number of samples of the true response that lies in each class of target values score this score will give us the harmonic mean of precision and recall mathematicallyf score is the weighted average of the precision and recall the best value of would be and worst would be we can cal... |
15,415 | help of log loss valuewe can have more accurate view of the performance of our model we can use log_loss function of sklearn metrics to compute log loss example the following is simple recipe in python which will give us an insight about how we can use the above explained performance metrics on binary classification mo... |
15,416 | performance metrics for regression problems we have discussed regression and its algorithms in previous herewe are going to discuss various performance metrics that can be used to evaluate predictions for regression problems mean absolute error (maeit is the simplest error metric used in regression problems it is basic... |
15,417 | example the following is simple recipe in python which will give us an insight about how we can use the above explained performance metrics on regression modelfrom sklearn metrics import _score from sklearn metrics import mean_absolute_error from sklearn metrics import mean_squared_error x_actual [ - y_predic [ - print... |
15,418 | machine learning with pipelines -machine automatic workflows introduction in order to execute and produce results successfullya machine learning model must automate some standard workflows the process of automate these standard workflows can be done with the help of scikit-learn pipelines from data scientist' perspecti... |
15,419 | deploymentat lastwe need to deploy the model this step involves applying and migrating the model to business operations for their use challenges accompanying ml pipelines in order to create ml pipelinesdata scientists face many challenges these challenges fall into the following three categoriesquality of data the succ... |
15,420 | from sklearn preprocessing import standardscaler from sklearn pipeline import pipeline from sklearn discriminant_analysis import lineardiscriminantanalysis nowwe need to load the pima diabetes dataset as did in previous examplespath " :\pima-indians-diabetes csvheadernames ['preg''plas''pres''skin''test''mass''pedi''ag... |
15,421 | featureunion tool at lasta logistic regression model will be createdand the pipeline will be evaluated using -fold cross validation firstimport the required packages as followsfrom pandas import read_csv from sklearn model_selection import kfold from sklearn model_selection import cross_val_score from sklearn pipeline ... |
15,422 | output the above output is the summary of accuracy of the setup on the dataset |
15,423 | machine learning improving performance of ml models performance improvement with ensembles ensembles can give us boost in the machine learning result by combining several models basicallyensemble models consist of several individually trained supervised learning models and their results are merged in various ways to ac... |
15,424 | voting in this ensemble learning modelmultiple models of different types are built and some simple statisticslike calculating mean or median etc are used to combine the predictions this prediction will serve as the additional input for training to make the final prediction bagging ensemble algorithms the following are ... |
15,425 | nextbuild the model with the help of following scriptmodel baggingclassifier(base_estimator=cartn_estimators=num_treesrandom_state=seedcalculate and print the result as followsresults cross_val_score(modelxycv=kfoldprint(results mean()output the output above shows that we got around accuracy of our bagged decision tree... |
15,426 | kfold kfold(n_splits= random_state=seedwe need to provide the number of trees we are going to build here we are building trees with split points chosen from featuresnum_trees max_features nextbuild the model with the help of following scriptmodel randomforestclassifier(n_estimators=num_treesmax_features=max_featurescal... |
15,427 | array[:, nextgive the input for -fold cross validation as followsseed kfold kfold(n_splits= random_state=seedwe need to provide the number of trees we are going to build here we are building trees with split points chosen from featuresnum_trees max_features nextbuild the model with the help of following scriptmodel ext... |
15,428 | nowwe need to load the pima diabetes dataset as did in previous examplespath " :\pima-indians-diabetes csvheadernames ['preg''plas''pres''skin''test''mass''pedi''age''class'data read_csv(pathnames=headernamesarray data values array[:, : array[:, nextgive the input for -fold cross validation as followsseed kfold kfold(n... |
15,429 | from sklearn ensemble import gradientboostingclassifier nowwe need to load the pima diabetes dataset as did in previous examplespath " :\pima-indians-diabetes csvheadernames ['preg''plas''pres''skin''test''mass''pedi''age''class'data read_csv(pathnames=headernamesarray data values array[:, : array[:, nextgive the input... |
15,430 | backpropagation gradient descent variants gradient-based optimization techniques practical implementation with pytorch summary automatic differentiation in deep learning numerical differentiation symbolic differentiation automatic differentiation fundamentals implementing automatic differentiation summary ... |
15,431 | dropout practical implementation in pytorch interpreting the business outcomes for deep learning summary convolutional neural networks convolution operation pooling operation convolution-detector-pooling building block stride padding batch normalization filter filter depth number of filters summarizing ... |
15,432 | long short-term memory practical implementation summary recent advances in deep learning going beyond classification in computer vision object detection image segmentation pose estimation generative computer vision natural language processing with deep learning transformer models bidirectional encoder repr... |
15,433 | nikhil ketkar currently leads the machine learning platform team at flipkartindia' largest ecommerce company he received his phd from washington state university following thathe conducted postdoctoral research at university of north carolina at charlottewhich was followed by brief stint in high-frequency trading at tr... |
15,434 | you can reach jojo atx |
15,435 | judy raj is google certified professional cloud architect she has great experience with the three leading cloud platforms-amazon web servicesazureand google cloud platform--and has co-authored book on google cloud platform with packt publications she has also worked with wide range of technologies in machine learningda... |
15,436 | his career has covered the life cycle of data across multiple domainssuch as us mortgage bankingretail/ecommerceinsuranceand industrial iot manohar has bachelor' degree with specialization in physicsmathematicscomputersand master' degree in project management he is currently living in bengaluruthe silicon valley of ind... |
15,437 | would like to thank my colleagues at flipkart and indixand the technical reviewersfor their feedback and comments will also like to thank charu mudholkar for proofreading the book in its final stages --nikhil ketkar would like to thank my beloved wifedivyafor her constant support --jojo moolayil xiii |
15,438 | this book has been drafted with unique approach the second edition focuses on the practicality of the topics within deep learning that help the reader to embrace modern tools with the right mathematical foundations the first edition focused on introducing meaningful foundation for the subjectwhile limiting the depth of... |
15,439 | part serves as brief introduction to machine learningdeep learningand pytorch we explore the evolution of the fieldfrom early rule-based systems to the present-day sophisticated algorithmsin an accelerated fashion part ii explores the essential deep learning building blocks introduces simple feed-forward neural network... |
15,440 | around the fundamentals and later explore practical exercises with real-life datasets concludes the book by looking at some of the recent trends within deep learning this is only cursory introduction and does not include any implementation details the objective is to highlight some advances in the research and the poss... |
15,441 | introduction to machine learning and deep learning the subject of deep learning has gained immense popularity recentlyandin the processhas given rise to several terminologies that make distinguishing them fairly complex one might find the task of neatly separating each field overwhelmingwith the sheer volume of overlap... |
15,442 | introduction to machine learning and deep learning ecosystem (ios and android)face detection on the cameraauto-correct and predictive text on keyboardsai-enhanced beautification appssmart assistants like siri/alexa/google assistantface-id (face unlock on iphones)video suggestions on youtubefriend suggestions on faceboo... |
15,443 | introduction to machine learning and deep learning the journey of deep learning starts with the field of artificial intelligencethe rightful parent of the fieldand has rich history going back to the the field of artificial intelligence can be defined in simple terms as the ability of machines to think and learn in more... |
15,444 | introduction to machine learning and deep learning formal description of the game of chess would be the representation of the boarda description of how each of the pieces movesthe starting configurationand description of the configuration wherein the game terminates with these notions formalizedit is relatively easy to... |
15,445 | introduction to machine learning and deep learning of map with edges labeled with distances and about of traffic (which is being constantly updated)allowing program to reason about the shortest path between points such knowledge-based systemswherein the knowledge was compiled by experts and represented in way that allo... |
15,446 | introduction to machine learning and deep learning machine learning in formal termswe define machine learning as the field within ai where intelligence is added without explicit programming human beings acquire knowledge for any task through learning given this observationthe focus of subsequent work in ai shifted ove... |
15,447 | introduction to machine learning and deep learning compute resourcesand human resources to engineer featuresa large class of problems are solvable the key limitation of mainstream machine language algorithms is that applying them to new problem domain requires massive amount of feature engineering for instanceconsider ... |
15,448 | introduction to machine learning and deep learning of data from the data itself furthermorethey organize concepts as hierarchy where complicated concepts are expressed using primitive concepts the field of deep learning has its primary focus on learning appropriate representations of data such that these could be used ... |
15,449 | introduction to machine learning and deep learning although these advancements are peripheral to deep learningthey have played big role in enabling advances in deep learning rerequisites the key prerequisites for reading this book include working knowledge of python and some coursework in linear algebracalculusand prob... |
15,450 | introduction to machine learning and deep learning installing the required libraries you need to install number of libraries in order to run the source code for the examples in this book we recommend installing the anaconda python distribution (simplifies the process of installing the required packages (using either c... |
15,451 | introduction to machine learning and deep learning over period over time and with experience--thus inducing intelligence without explicit programming the first question to ask is why we would be interested in the development of algorithms that improve their performance over timewith experience after allmany algorithms ... |
15,452 | introduction to machine learning and deep learning consider an abstract problem domain where we have data of the form , , xn ,yn where rn and + we do not have access to all such data but only subset using sour task is to generate computational procedure that implements the function such that we can use to make predicti... |
15,453 | introduction to machine learning and deep learning users to show the products they might be interested in buying the website has historical data on users and would like to implement this as feature to increase sales let' now see how this real-world problem maps on to the abstract problem of binary classification we des... |
15,454 | introduction to machine learning and deep learning note that instead of the prediction being binary class label + like in binary classificationwe have real valued prediction we measure performance over this task as the root-mean-square error (rmseover unseen data yi xi du note that the rmse is simply taking the diff... |
15,455 | introduction to machine learning and deep learning in listing - we generate the toy dataset by generating values equidistantly between - and as the input variable (xwe generate the output variable (ybased on where , is noise (random variationfrom normal distributionwith being the mean and being the standard deviation t... |
15,456 | introduction to machine learning and deep learning output[shape of x_train( ,shape of y_train( ,figure - toy dataset nextwe use very simple algorithm to generate modelcommonly referred to as least squares given data set of the form {( )( )(xnyn)}where rn and rthe least squares model takes the form bxwhere is vector suc... |
15,457 | introduction to machine learning and deep learning we can evaluate the model on the unseen data using the rmse metric we can also compute the rmse metric on the training data figure - plots the actual and predicted valuesand listing - shows the source code for generating the model listing - function to build model with... |
15,458 | introduction to machine learning and deep learning #create model with degree using the function create_model(x_train, output[train rmse(degree ) test rmse (degree ) figure - actual and predicted values for model with degree similarlylisting - and figure - repeat the exercise for model with degree = listing - creating m... |
15,459 | introduction to machine learning and deep learning figure - actual and predicted values for model with degree nextas shown in listing - we generate another model with the least squares algorithmbut we will transform to [ that iswe are approximating the given data with polynomial with degree listing - model with degree=... |
15,460 | introduction to machine learning and deep learning figure - actual and predicted values for model with degree the actual and predicted values are plotted in figure - figure - and figure - the source-code (functionfor creating the model is available in listing - we now have all the details in place to discuss the core c... |
15,461 | introduction to machine learning and deep learning we now consider the important concept of model capacitywhich corresponds to the degree of the polynomial in this example the data we generated was using second order polynomial (degree with some noise thenwe tried to approximate the data using three models (of degrees ... |
15,462 | introduction to machine learning and deep learning memorize the data this is referred to as rote learningthe logical extreme of overfitting this is why the capacity of the model needs to be tuned with respect to the amount of training data we have if the dataset is smallwe are better off training models with lower capa... |
15,463 | introduction to machine learning and deep learning #create random data np linspace(- , , signal noise np random normal( signal noise x_train [ : y_train [ : train_rmse [test_rmse [degree #define range of values for lambda lambda_reg_values np linspace( , , for lambda_reg in lambda_reg_values#for each value of lambdacom... |
15,464 | introduction to machine learning and deep learning plt xlabel( "$\lambda$"plt ylabel("rmse"plt legend(["train""test"]loc plt show(we can compute the value of using the closed form (xtx li)- xty we illustrate keeping the degree fixed at value of and varying the value of in listing - the training rmse (seen dataand test ... |
15,465 | introduction to machine learning and deep learning are the concepts of generalizing over unseen examplesoverfitting and underfitting the training datathe capacity of the modeland the notion of regularization readers are encouraged to try out the examples in the source code listings in the next we will explore pytorch a... |
15,466 | introduction to pytorch the recent years have witnessed major releases of frameworks and tools to democratize deep learning to the masses todaywe have plethora of options at our disposal this aims to provide an overview of pytorch we will be using pytorch extensively throughout the book for implementing deep learning e... |
15,467 | introduction to pytorch with deep learning to enable easieracceleratedand quality solutions for experiments in research and productsenterprises require large amount of abstraction that can do the heavy lifting for ground tasks this would help researchers and developers focus on the tasks that matterrather than investin... |
15,468 | introduction to pytorch learning problems while focusing on the tasks that matter and be able to easily debugexperimentand deploy for the aforementioned reasonspytorch has seen wider adoption in enterprises if you follow the media around deep learningyou might have read articles that mention new large organization adop... |
15,469 | introduction to pytorch tensor is nothing but multi-dimensional array of objects of the same type (usually floating-point numbersalthough bit of an oversimplificationit' fair to say that at lower level of abstractionall computation in pytorch is tensors and operations over tensors thusin order for you to be fluent with... |
15,470 | introduction to pytorch pytorch is very rich library that provides numerous functions that enable building blocks for deep learning this looks briefly at some of the functionalities pytorch provides for creating tensors and performing data munging operationslinear algebraand mathematical operations to beginlet' explore... |
15,471 | introduction to pytorch listing - the shape of tensor in [ ] torch tensor([[ ],[ ]]in [ ] shape out[ ]torch size([ ]in [ ] out[ ]tensor([[ ][ ]]we can try out more examples with different shapes listing - explores tensors with different shapes listing - the shape of tensor (continuedin [ ] torch tensor([[ ],[ ],[ ]]in ... |
15,472 | introduction to pytorch listing - creating tensors with arbitrary dimensions in [ ] torch tensor([[[ ],[ ]],[[ ],[ ]]]in [ ] shape out[ ]torch size([ ]in [ ] out[ ]tensor([[[ ][ ]][[ ][ ]]]just as we can build tensors with python listswe can build tensors with numpy arrays this functionality can come in most handy when... |
15,473 | introduction to pytorch listing - creating tensors from numpy import numpy as np np array([ ]tensor_a torch from_numpy(atensor_a output[tensor([ ]as we mentioned in the introductiontensors are multi-dimensional arrays of the same type we can specify the type when we construct tensor in the following exampleswe initiali... |
15,474 | introduction to pytorch in [ ] torch tensor([[ ],[ ]]dtype=torch float in [ ] out[ ]tensor([[ ][ ]]dtype=torch float table - shows the different datatypes and their pytorch equivalents table - datatypes and their pytorch equivalents data type pytorch equivalent -bit floating point torch float or torch float -bit floati... |
15,475 | introduction to pytorch listing - creating tensor with random values in [ ] torch rand( , , in [ ] out[ ]tensor([[[ ][ ]][[ ][ ]]]in [ ] shape out[ ]torch size([ ]another common requirement is to construct tensor of zeros listing - demonstrates the creation of tensor with defined shape having all zeros listing - creati... |
15,476 | introduction to pytorch listing - creating tensor having all ones in [ ]ones torch ones( , , in [ ]ones out[ ]tensor([[[ ][ ]][[ ][ ]]]in [ ]ones shape out[ ]torch size([ ]another common requirement is the construction of identity matrices (tensorslisting - demonstrates the creation of an identity matrix tensor ( all d... |
15,477 | introduction to pytorch listing - creating tensor filled with an arbitrary value in [ ] torch full(( , ) in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ] common use case is also to build tensors with linearly spaced floating-point numbers listing - demonstrates the creation of tensor with linearly space... |
15,478 | introduction to pytorch sometimes we need to create tensors with dimensions similar to existing tensors the example in listing - illustrates this listing - creating tensor with dimensions similar to another tensor in [ ] torch tensor([[ ],[ ]]in [ ] torch zeros_like(ain [ ] out[ ]tensor([[ ][ ]]in [ ] torch ones_like(a... |
15,479 | introduction to pytorch in [ ] dtype out[ ]torch int in [ ] torch tensor([[ , ],[ , ]]dtype=torch intin [ ] out[ ]tensor([[ ][ ]]dtype=torch int similarlylisting - shows the construction of tensor with range of integers listing - creating tensor with range of integers in [ ] torch arange( , step= in [ ] out[ ]tensor([ ... |
15,480 | introduction to pytorch tensor munging operations having looked at tensors and tensor construction operationslet' now dive deeper into operations with tensors we will start by looking at accessing individual elements of tensor the following example should be familiaras it is identical to the list indexing operator in ... |
15,481 | introduction to pytorch listing - accessing single value from tensor in [ ] torch tensor([[[ ]]]in [ ] out[ ]tensor([[[ ]]]in [ ] shape out[ ]torch size([ ]in [ ] item(out[ ] the view method provides an easy way to reshape tensor essentiallythe values in tensor are allocated in contiguous blocks of memory the pytorch t... |
15,482 | introduction to pytorch in [ ] shape out[ ]torch size([ ]it is important to note how (the order in which the elements are placedthe view method reshapes the tensor listing - demonstrates verifying the size of tensor after reshaping with the 'viewmethod listing - verifying the size of tensor after reshaping with view in... |
15,483 | introduction to pytorch listing - concatenating two tensors in [ ] torch zeros( , in [ ] out[ ]tensor([[ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch cat([ , , ], in [ ] out[ ]tensor([[ ][ ][ ][ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch cat([ , , ], in [ ] out[ ]tensor([[ ][ ]]in [ ] shape out[ ]torch... |
15,484 | introduction to pytorch the stack operation allows you to construct tensor by stacking list of tensors along dimension the resultant tensor will have its dimension increased by one listing - shows how the stacking operation operates along each dimension note that the stack operation takes two parametersthe list of tens... |
15,485 | introduction to pytorch in [ ] out[ ]tensor([[[ ][ ][ ]][[ ][ ][ ]]]in [ ] shape out[ ]torch size([ ]in [ ] torch stack([ , , ] in [ ] out[ ]tensor([[[ ]][[ ]]]in [ ] shape out[ ]torch size([ ]the chunk operation chops up tensor into the given number of parts along given direction note that the first parameter is the t... |
15,486 | introduction to pytorch tensor([[ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch chunk( in [ ] out[ ](tensor([[ ][ ]])tensor([[ ][ ]])tensor([[ ][ ]])tensor([[ ][ ]])tensor([[ ][ ]])note that when the length of the tensor along the dimension on which partitioning is being performed is not mu... |
15,487 | introduction to pytorch listing - chunking tensors (continuedin [ ] torch chunk( in [ ] out[ ](tensor([[ ][ ][ ][ ]])tensor([[ ][ ][ ][ ]])tensor([[ ][ ]])just as the chunk method enables you to split tensor into the given number of partsthe split method does the same operation but given the size of the part note the d... |
15,488 | introduction to pytorch [ ][ ][ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch split( , , in [ ] out[ ](tensor([[ ],[ ]])tensor([[ ],[ ]])tensor([[ ],[ ]])tensor([[ ],[ ]])tensor([[ ],[ ]])the index_select method allows you to extract parts of tensor along given dimension note that the method takes three argumen... |
15,489 | introduction to pytorch in [ ] shape out[ ]torch size([ ]in [ ]index torch longtensor([ ]in [ ] torch index_select( indexin [ ] out[ ]tensor([[ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch index_select( indexin [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]the masked_select methodillustrated in lis... |
15,490 | introduction to pytorch [ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ]mask torch bytetensor([[ ],[ ],[ ]]in [ ]mask out[ ]tensor([[ ][ ][ ]]dtype=torch uint in [ ]mask shape out[ ]torch size([ ]in [ ] torch masked_select(amaskin [ ] out[ ]tensor([ ]in [ ] shape out[ ]torch size([ ]the squeeze method removes all dimensi... |
15,491 | introduction to pytorch [[ ][ ]]]in [ ] shape out[ ]torch size([ ]in [ ] squeeze(in [ ] out[ ]tensor([[ ][ ]]in [ ] shape out[ ]torch size([ ]similarlythe unsqueeze method adds new dimension with value of oneas illustrated in listing - note how the extra dimension could be added at three different positions listing - r... |
15,492 | introduction to pytorch tensor([[[ ][ ]]]in [ ] shape out[ ]torch size([ ]in [ ] torch unsqueeze( in [ ] out[ ]tensor([[[ ]][[ ]]]in [ ] shape out[ ]torch size([ ]in [ ] torch unsqueeze( in [ ] out[ ]tensor([[[ ][ ]][[ ][ ]]]in [ ] shape out[ ]torch size([ ]the unbind function breaks up given tensor into separate tenso... |
15,493 | introduction to pytorch listing - extracting parts of tensor using unbind in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ]torch unbind( out[ ](tensor([ ])tensor([ ])tensor([ ])in [ ]torch unbind( out[ ](tensor([ ])tensor([ ])tensor([ ])listing - illustrates creating tensor from an existing tensor ... |
15,494 | introduction to pytorch in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch rand( , in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch where( abin [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]the any and all methodsillustrated in listing - enable you to... |
15,495 | introduction to pytorch listing - conducting logical operations on tensors using the any and all methods in [ ] torch rand( , in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ]torch any( out[ ]tensor( dtype=torch uint in [ ]torch any( out[ ]tensor( dtype=torch uint in [ ]torch all( out[ ]tensor( dty... |
15,496 | introduction to pytorch in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] view( ,- in [ ] out[ ]tensor([[ ][ ][ ]]in [ ] shape out[ ]torch size([ ]the flatten method can be used to collapse the dimensions of given tensor starting with particular dimension listing - demonstrates collapsing the dimen... |
15,497 | introduction to pytorch [[[ ][ ]][[ ][ ]]]]in [ ] shape out[ ]torch size([ ]in [ ] torch flatten(ain [ ] out[ ]tensor([ ]in [ ] shape out[ ]torch size([ ]in [ ] torch flatten(astart_dim= in [ ] out[ ]tensor([ ]in [ ] shape out[ ]torch size([ ]in [ ] torch flatten(astart_dim= in [ ] out[ ]tensor([[ ][ ]]in [ ] shape out... |
15,498 | introduction to pytorch in [ ] torch flatten(astart_dim= in [ ] out[ ]tensor([[[ ][ ]][[ ][ ]]]in [ ] shape out[ ]torch size([ ]in [ ] torch flatten(astart_dim= in [ ] out[ ]tensor([[[[ ][ ]][[ ][ ]]][[[ ][ ]][[ ][ ]]]]in [ ] shape out[ ]torch size([ ]the gather method allows us to extract values from tensor along give... |
15,499 | introduction to pytorch listing - extracting values from tensor using the gather method in [ ] torch rand( , in [ ] out[ ]tensor([[ ][ ][ ][ ]]in [ ] shape out[ ]torch size([ ]in [ ] torch longtensor([[ , , , ]]in [ ] out[ ]tensor([[ ]]in [ ] shape out[ ]torch size([ ]in [ ] gather( ,bin [ ] out[ ]tensor([[ ]]in [ ] sh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.