id int64 0 25.6k | text stringlengths 0 4.59k |
|---|---|
15,700 | recurrent neural networks figure - long short-term memory network practical implementation this section describes practical implementation of an rnn and lstm with pytorch we will divide the exercise into two parts firstwe will use just the vanilla rnn network with no additional processing (from the universe of nlpand ... |
15,701 | recurrent neural networks we recommend leveraging kaggle notebook for the exercise (with the internet option turned on and the gpu accelerator enabledlet' get started by importing the essential packages (listing - listing - importing the packages for the rnn import numpy as np linear algebra import pandas as pd data pr... |
15,702 | recurrent neural networks listing - reading data into memory #read the csv dataset using pandas df pd read_csv("/input/imdb-dataset-sentiment-analysis-incsv-format/train csv"print("df shape :\ ",df shapeprint("df label ",df label value_counts()df head(output[df shape ( df label namelabeldtypeint we have only two column... |
15,703 | recurrent neural networks listing - defining the tokenizerfieldsand dataset for training and validation #define custom tokenizer my_tokenizer lambda :str(xsplit(#define fields for our input dataset text data field(sequential=truelowertrue,tokenize my_tokenizer,use_vocab=truelabel data field(sequential false,use_vocab f... |
15,704 | recurrent neural networks val_iterator data bucketiterator(val_datadevice devicebatch_size sort_key lambda :len( textsort_within_batch false repeat falseprint(text vocab freqs most_common()[: ]output[[('the' )(' ' )('and' )('of' )('to' ('is' )('in' )(' ' )('this' )('that' )in listing - we processed couple of things tha... |
15,705 | recurrent neural networks nextwe define our data fields list that would be required while creating the dataset this list represents each column within the dataset if we plan to not use particular column within this datasetwe would need to assign "noneto the column name when defining the list of columns we assign this l... |
15,706 | recurrent neural networks listing - defining the rnn class class rnnmodel(nn module)def __init__(self,embedding_dim,input_dim,hidden_dimoutput_dim)super(__init__(self embedding nn embedding(input_dim,embedding_dimself rnn nn rnn(embedding_dim,hidden_dimself fc nn linear(hidden_dim,output_dimdef forward(self,text)embed... |
15,707 | recurrent neural networks higher number will not always be valuableand it increases computation load significantly alsowe select dimensions for our hidden layer and (since the outcome is binarydimension for our output layer nextin listing - we define two functions that will wrap the training step and evaluation step fo... |
15,708 | recurrent neural networks model eval(#explcitly set model to eval mode for ibatch in enumerate(data_iterator)with torch no_grad()predictions model(batch textloss loss_function(predictions reshape(- , )batch label float(reshape(- , )acc accuracy(predictions reshape(- , )batch label reshape(- , )epoch_loss +loss item(e... |
15,709 | recurrent neural networks #define optimizerloss function optimizer torch optim adam(model parameters()lr= - criterion nn bcewithlogitsloss(#transfer components to gpuif available model model to(devicecriterion criterion to(devicefinallyin listing - we train the model instantiated above with the define loss functions an... |
15,710 | recurrent neural networks output[epoch - train loss train predicted correct train denom percaccuracy valid loss valid predicted correct val denom percaccuracy epoch - train loss train predicted correct train denom percaccuracy valid loss valid predicted correct val denom percaccuracy epoch - train loss train predicted ... |
15,711 | recurrent neural networks in our second experimentwe will leverage tokenizer from spacy (rather than using our custom tokenizerand pretrained word embedding (instead of training one from scratch)and add bidirectional lstm layers (instead of unidirectional rnn layerswe will also add dropout to reduce overfitting we actu... |
15,712 | recurrent neural networks #define list of tuples of fields trainval_fields [("text",text),("label",label)#contruct dataset train_dataval_data data tabulardataset splits(path input_data_pathtrain "train csv"validation "valid csv"format "csv"skip_header truefields trainval_fields#build vocab using pretrained max_vocab_si... |
15,713 | recurrent neural networks while building the vocabularywe use vectors 'fasttext simple dto tell pytorch to download the pretrained fasttext vector and create an embedding vector for the words in our text field (if you are using kaggle kernelthe internet option should be turned on in the notebook environment settingsthi... |
15,714 | recurrent neural networks def forward(selftexttext_lengths)embedded self dropout(self embedding(text)#pack sequence packed_embedded nn utils rnn pack_padded_ sequence(embeddedtext_lengthspacked_output(hiddencellself lstm(packed_ embedded#unpack sequence outputoutput_lengths nn utils rnn pad_packed_ sequence(packed_o... |
15,715 | recurrent neural networks listing - defining the model properties and copying the pretrained weights #define model input parameters input_dim len(text vocabembedding_dim hidden_dim output_dim n_layers bidirectional true dropout #create model instance model improvedrnn(input_dimembedding_dimhidden_dimoutput_dimn_layersb... |
15,716 | recurrent neural networks output [torch size([ ]nextwe define the train and evaluate functionssimilar to our previous exercise the only difference is that we need to handle text_lengths as an additional parameter in the model we will also define the accuracy function required to compute the binary accuracy and define t... |
15,717 | recurrent neural networks #define evaluate step def evaluate(modeliteratorcriterion)epoch_loss,epoch_acc,epoch_denom , , model eval(with torch no_grad()for batch in iteratortexttext_lengths batch text predictions model(texttext_lengthssqueeze( loss criterion(predictionsbatch label float()acc accuracy(predictionsbatch l... |
15,718 | recurrent neural networks #finally lets train our model for epochs n_epochs for epoch in range(n_epochs)train_losstrain_acc,train_num train(modeltrain_ iteratoroptimizercriterionvalid_lossvalid_acc,val_num evaluate(modelval_ iteratorcriterionprint("epoch-",epochprint( '\ttrain loss{train_loss ftrain predicted correc... |
15,719 | recurrent neural networks epoch train loss train predicted correct train denom percaccuracy valid loss valid predicted correct val denom percaccuracy epoch train loss train predicted correct train denom percaccuracy valid loss valid predicted correct val denom percaccuracy epoch train loss train predicted correct ... |
15,720 | recurrent neural networks common to iterate using lstms and grusand take the best you can read more about this research at discussing the details of grus is beyond the scope of this readers are encouraged to explore this topic further on their own ummary in this we covered the basics of recurrent neural networks (rnnst... |
15,721 | recent advances in deep learning so farthis book has discussed important topics in the realm of deep learningfeed-forward networksconvolutional neural networksand recurrent neural networks we described their practical aspectsincluding implementationtrainingvalidationand tuning models for improvement with pytorch althou... |
15,722 | recent advances in deep learning oing beyond classification in computer vision in we studied computer vision problems within deep learning that are solved using convolutional neural networks this idea was novel and groundbreaking focused on only one key area-classification we studied the classic example of mnist handwr... |
15,723 | recent advances in deep learning figure - object detection in computer vision image source the bounding boxes against each person (multiple people are identifiedare outcomes from object detection real-life use cases for object detection include identifying cars from cctv video streamthereby tracking traffic on importan... |
15,724 | recent advances in deep learning the image under image segmentation that isinstead of rectangular bounding boxas in object detectionwe would have the actual pixel outline of the object (see figure - figure - image segmentation in computer vision image source instead of the bounding boxwe now have more granular outlines... |
15,725 | recent advances in deep learning to learn more about semantic image segmentationvisit developer apple com/videos/play/wwdc / ose estimation pose estimation is computer vision technique that predicts and tracks the location of person or object essentiallypose estimation predicts the body part or joint positions of perso... |
15,726 | recent advances in deep learning the practical applications of pose estimation are similar to image segmentation and object detectionalthough the applications for pose estimation are more meaningful and targeted--for exampletracking the activity of personsuch as runningcyclingetc activity tracking enables security surv... |
15,727 | recent advances in deep learning figure - gan-generated sample images the majority of the images look fairly realistic and identifiable--for examplehorseshipcaretc training gans has been difficult problem and often requires large computing resources producing larger size images increases the complexity even further non... |
15,728 | recent advances in deep learning the blind with camera that describes surroundings in natural language to learn more about the prototypevisit watch? =xe rcj jy several emerging ecommerce enterprises are leveraging gans to design graphic tees for exampleprismaa popular photo-editing appand faceappa controversial yet int... |
15,729 | recent advances in deep learning transformer models in late google published its findings about the transformer networka groundbreaking deep learning model for nlp the paper "attention is all you need(shift in the research community for language models for whilernns were the best choice to process sequential data howev... |
15,730 | recent advances in deep learning corpus of text data (largely available over the internetis used for training language representation models nextthe model is trained and fine-tuned in supervised fashion for the specific use case of interest an example would the sentiment classification use case we explored in you can f... |
15,731 | recent advances in deep learning groknet the computer vision topics we have explored so far are all related to single-task learning that iswe specifically design network with one loss function and desired outcome--classifying an image into distinct categories modern problems in the digital age have more complex requir... |
15,732 | recent advances in deep learning maintenance and computational cost and improve coverage by removing the need for separate model for each vertical application groknet leverages multi-task learning approach to train single computer vision trunk the model was trained over distinct datasets across several commerce vertica... |
15,733 | recent advances in deep learning additional noteworthy research this section describes few research publications relevant to the field of deep learning that are really exciting for folks to explore independently as next steps to advance in the field discussing any details for the research is beyond the scope of this b... |
15,734 | recent advances in deep learning multi-domain wavenet autoencoderwith shared encoder and domain-independent latent space that is trained end-to-end on waveforms paper live face de-identification in video this method enables face de-identification in fully automatic setting for live videos at high frame rates using feed... |
15,735 | abs method activation functions hyperbolic tangent linear unit relu sigmoid activation softmax layer adaptive moment estimation (adam) addbmm function addmm function addmv function addr function allclose method area under the curve (auc) argmax method argmin method argsort function artificial intelligence (ai) autograd... |
15,736 | mathematics important concepts statistics data mining artificial intelligence natural language processing deep learning important concepts machine learning methods supervised learning classification regression nsupervised learning lustering dimensionality reduction anomaly detection association rule-mining semi-super... |
15,737 | building machine intelligence machine learning pipelines supervised machine learning pipeline unsupervised machine learning pipeline real-world case studypredicting student grant recommendations objective data retrieval data preparation modeling model evaluation model deployment prediction in action challenges in mach... |
15,738 | #part iithe machine learning pipeline # processingwranglingand visualizing data data collection sv json xml html and scraping sql ata description numeric text categorical ata wrangling nderstanding data filtering data typecasting transformations imputing missing values handling duplicates handling categorical dat... |
15,739 | # feature engineering and selection featuresunderstand your data better data and datasets features models revisiting the machine learning pipeline feature extraction and engineering what is feature engineering? why feature engineering? how do you engineer features? feature engineering on numeric data raw measures b... |
15,740 | feature engineering on temporal data date-based features time-based features feature engineering on image data image metadata features raw image and channel pixels grayscale image pixels binning image intensity distribution image aggregation statistics edge detection object detection localized feature extraction v... |
15,741 | odel evaluation evaluating classification models evaluating clustering models evaluating regression models odel tuning introduction to hyperparameters the bias-variance tradeoff cross validation hyperparameter tuning strategies odel interpretation nderstanding skater model interpretation in action odel deployme... |
15,742 | egression analysis types of regression assumptions evaluation criteria modeling linear regression decision tree based regression next steps summary # analyzing movie reviews sentiment problem statement setting up dependencies getting the data text pre-processing and normalization unsupervised lexicon-based models... |
15,743 | # customer segmentation and effective cross selling online retail transactions dataset exploratory data analysis customer segmentation bjectives strategies clustering strategy cross selling market basket analysis with association rule-mining association rule-mining basics association rule-mining in action summary # ... |
15,744 | # analyzing music trends and recommendations the million song dataset taste profile exploratory data analysis loading and trimming data enhancing the data visual analysis ecommendation engines types of recommendation engines utility of recommendation engines popularity-based recommendation engine item similari... |
15,745 | # deep learning for computer vision convolutional neural networks image classification with cnns problem statement dataset cnn based deep learning classifier from scratch cnn based deep learning classifier with pretrained models artistic style transfer with cnns ackground preprocessing loss functions custom op... |
15,746 | dipanjan sarkar is data scientist at intelon mission to make the world more connected and productive he primarily works on data scienceanalyticsbusiness intelligenceapplication developmentand building large-scale intelligent systems he holds master of technology degree in information technology with specializations in ... |
15,747 | tushar sharma has master' degree from international institute of information technologybangalore he works as data scientist with intel his work involves developing analytical solutions at scale using enormous volumes of infrastructure data in his previous rolehe worked in the financial domain developing scalable machin... |
15,748 | jojo moolayil is an artificial intelligence professional and published author of the booksmarter decisions the intersection of iot and decision science with over five years of industrial experience in machine learningdecision scienceand iothe has worked with industry leaders on high impact and critical projects across ... |
15,749 | this book would have definitely not been reality without the help and support from some excellent people and organizations that have helped us along this journey first and foremosta big thank you to all our readers for not only reading our books but also supporting us with valuable feedback and insights trulywe have le... |
15,750 | am indebted to my familyteachersfriendscolleaguesand mentors who have inspired and encouraged me over the years would also like to take this opportunity to thank my co-authors and good friends dipanjan sarkar and tushar sharmayou guys are amazing special thanks to sanchita mandalcelestin johnmatthew moodieand apress fo... |
15,751 | the availability of affordable compute power enabled by moore' law has been enabling rapid advances in machine learning solutions and driving adoption across diverse segments of the industry the ability to learn complex models underlying the real-world processes from observed (trainingdata through systemiceasy-to-apply... |
15,752 | data is the new oil and machine learning is powerful concept and framework for making the best out of it in this age of automation and intelligent systemsit is hardly surprise that machine learning and data science are some of the top buzz words the tremendous interest and renewed investments in the field of data scien... |
15,753 | understanding machine learning |
15,754 | machine learning basics the idea of making intelligentsentientand self-aware machines is not something that suddenly came into existence in the last few years in fact lot of lore from greek mythology talks about intelligent machines and inventions having self-awareness and intelligence of their own the origins and the ... |
15,755 | in subsequent besides thiswe also cover the different inter-disciplinary fields associated with machine learningwhich are in fact related fields all under the umbrella of artificial intelligence this book is more focused on applied or practical machine learninghence the major focus in most of the will be the applicatio... |
15,756 | it would be like"heymy brain did most of the thinking for me!this is exactly why it is difficult to make machines learn to solve these problems like regular computational programs like computing loan interest or tax rebates solutions to problems that cannot be programmed inherently need different approach where we use ... |
15,757 | figure - traditional programming paradigm from figure - you can get the idea that the core inputs that are given to the computer are data and one or more programs that are basically code written with the help of programming languagesuch as high-level languages like javapythonor low-level like or even assembly programs ... |
15,758 | figure - machine learning paradigm figure - reinforces the fact that in the machine learning paradigmthe machinein this context the computertries to use input data and expected outputs to try to learn inherent patterns in the data that would ultimately help in building model analogous to computer programwhich would hel... |
15,759 | of machine learning processes and you need to change your thinking too from the traditional based approaches toward being more data-driven the beauty of machine learning is that it is never domain constrained and you can use techniques to solve problems spanning multiple domainsbusinessesand industries alsoas depicted ... |
15,760 | lack of sufficient human expertise in domain ( simulating navigations in unknown territories or even spatial planetsscenarios and behavior can keep changing over time ( availability of infrastructure in an organizationnetwork connectivityand so onhumans have sufficient expertise in the domain but it is extremely diffic... |
15,761 | figure - defining the components of learning algorithm we can simplify the definition as follows machine learning is field that consists of learning algorithms thatimprove their performance at executing some task over time with experience while we discuss at length each of these entities in the following sectionswe wil... |
15,762 | denoted by vector (python listsuch that each element in the vector is for specific data feature or attribute we discuss more about features and data points in detail in future section as well as in "feature engineering and selectioncoming back to the typical tasks that could be classified as machine learning tasksthe f... |
15,763 | defining the experiencee at this pointyou know that any learning algorithm typically needs data to learn over time and perform specific taskwhich we named as the process of consuming dataset that consists of data samples or data points such that learning algorithm or model learns inherent patterns is defined as the ex... |
15,764 | multi-disciplinary field we have formally introduced and defined machine learning in the previous sectionwhich should give you good idea about the main components involved with any learning algorithm let' now shift our perspective to machine learning as domain and field you might already know that machine learning is m... |
15,765 | you could say that data science is like broad inter-disciplinary field spanning across all the other fields which are sub-fields inside it of course this is just simple generalization and doesn' strictly indicate that it is inclusive of all other other fields as supersetbut rather borrows important concepts and methodo... |
15,766 | theoretical computer science applied or practical computer science the two major areas under computer science span across multiple fields and domains wherein each field forms part or sub-field of computer science the main essence of computer science includes formal languagesautomata and theory of computationalgorithmsd... |
15,767 | programming languages programming language is language that has its own set of symbolswordstokensand operators having their own significance and meaning thus syntax and semantics combine to form formal language in itself this language can be used to write computer programswhich are basically real-world implementations ... |
15,768 | figure - drew conway' data science venn diagram figure - is quite intuitive and easy to interpret basically there are three major components and data science sits at the intersection of them math and statistics knowledge is all about applying various computational and quantitative math and statistical based techniques ... |
15,769 | figure - brendan tierney' depiction of data science as true multi-disciplinary field if you observe his depiction closelyyou will see lot of the domains mentioned here are what we just talked about in the previous sections and matches substantial part of figure - you can clearly see data science being the center of att... |
15,770 | important concepts in this sectionwe discuss some key terms and concepts from applied mathematicsnamely linear algebra and probability theory these concepts are widely used across machine learning and form some of the foundational structures and principles across machine learning algorithmsmodelsand processes scalar s... |
15,771 | in [ ]view matrix print( [[ [ [ ]in [ ]view dimensions print( shape( thus you can see how we can easily leverage numpy arrays to represent matrices you can think of dataset with rows and columns as matrix such that the data features or attributes are represented by columns and each row denotes data sample we will be us... |
15,772 | tensor you can think of tensor as generic array tensors are basically arrays with variable number of axes an element in three-dimensional tensor can be denoted by tx, , where xyz denote the three axes for specifying element norm the norm is measure that is used to compute the size of vector often also defined as the me... |
15,773 | singular value decomposition the process of singular value decompositionalso known as svdis another matrix decomposition or factorization process such that we are able to break down matrix to obtain singular vectors and singular values any real matrix will always be decomposed by svd even if eigen decomposition may not... |
15,774 | random variable used frequently in probability and uncertainty measurementa random variable is basically variable that can take on various values at random these variables can be of discrete or continuous type in general probability distribution probability distribution is distribution or arrangement that depicts the l... |
15,775 | bayes theorem this is another rule or theorem which is useful when we know the probability of an event of interest ( )the conditional probability for another event based on our event of interest ( aand we want to determine the conditional probability of our event of interest given the other event has taken place ( bthi... |
15,776 | data mean median modemoderesult(mode=array([ ])count=array([ ])standard deviation variance skew- kurtosis- libraries and frameworks like pandasscipyand numpy in general help us compute descriptive statistics and summarize data easily in python we cover these frameworks as well as basic data analysis and visualization i... |
15,777 | figure - diverse major facets under the ai umbrella some of the main objectives of ai include emulation of cognitive functions also known as cognitive learningsemanticsand knowledge representationlearningreasoningproblem solvingplanningand natural language processing ai borrows toolsconceptsand techniques from statisti... |
15,778 | information extraction sentiment and emotion analysis topic segmentation using techniques from nlp and text analyticsyou can work on text data to processannotateclassifyclustersummarizeextract semanticsdetermine sentimentand much morethe following example snippet depicts some basic nlp operations on textual data where ... |
15,779 | figure - constituency parse tree for our sample sentence thus you can clearly see that figure - depicts the constituency grammar based parse tree for our sample sentencewhich consists of multiple noun phrases (npeach phrase has several words that are also annotated with their own parts of speech (postags we cover more ... |
15,780 | figure - performance comparison of deep learning and traditional machine learning by andrew ng indeedas rightly pointed out by andrew ngthere have been several noticeable trends and characteristics related to deep learning that we have noticed over the past decade they are summarized as follows deep learning algorithms... |
15,781 | "deepneural network usually is considered to have at least more than one hidden layer besides the input and output layers usually it consists of minimum of three to four hidden layers deep architectures have multi-layered architecture where each layer consists of multiple non-linear processing units each layer' input i... |
15,782 | important concepts in this sectionwe discuss some key terms and concepts from deep learning algorithms and architecture this should be useful in the future when you are building your own deep learning models artificial neural networks an artificial neural network (annis computational model and architecture that simulat... |
15,783 | backpropagation the backpropagation algorithm is popular technique to train anns and it led to resurgence in the popularity of neural networks in the the algorithm typically has two main stages--propagation and weight updates they are described briefly as follows propagation the input data sample vectors are propagate... |
15,784 | pooling layerswhich are basically layers that perform non-linear down sampling to reduce the input size and number of parameters from the convolutional layer output to generalize the model moreprevent overfitting and reduce computation time filters go through the heights and width of the input and reduce it by taking a... |
15,785 | figure - clearly depicts how the unrolled network will accept sequences of length in each pass of the input data and operate on the same long short-term memory networks rnns are good in working on sequence based data but as the sequences start increasingthey start losing historical context over time in the sequence and... |
15,786 | methods based on the amount of human supervision in the learning process supervised learning unsupervised learning semi-supervised learning reinforcement learning methods based on the ability to learn from incremental data samples batch learning online learning methods based on their approach to generalization from dat... |
15,787 | classification regression let' look at these two machine learning tasks and observe the subset of supervised learning methods that are best suited for tackling these tasks classification the classification based tasks are sub-field under supervised machine learningwhere the key objective is to predict output labels or ... |
15,788 | both the casesthe output class is scalar value pointing to one specific class multi-label classification tasks are such that based on any input data samplethe output response is usually vector having one or more than one output class label simple real-world problem would be trying to predict the category of news articl... |
15,789 | multiple regression is also known as multivariable regression these methods try to model data where we have one response output variable in each observation but multiple explanatory variables in the form of vector instead of single explanatory variable the idea is to predict based on the different features present in r... |
15,790 | we explore these tasks briefly in the following sections to get good feel of how unsupervised learning methods are used in the real world clustering clustering methods are machine learning methods that try to find patterns of similarity and relationships among data samples in our dataset and then cluster these samples... |
15,791 | besides thiswe have several methods that recently came into the clustering landscapelike birch and clarans dimensionality reduction once we start extracting attributes or features from raw data samplessometimes our feature space gets bloated up with humongous number of features this poses multiple challenges including ... |
15,792 | anomaly detection the process of anomaly detection is also termed as outlier detectionwhere we are interested in finding out occurrences of rare events or observations that typically do not occur normally based on historical data samples sometimes anomalies occur infrequently and are thus rare eventsand in other instan... |
15,793 | figure - unsupervised learningassociation rule-mining from figure - you can clearly see that based on different customer transactions over period of timewe have obtained the items that are closely associated and customers tend to buy them together some of these frequent item sets are depicted like {meateggs}{milkeggsan... |
15,794 | this iterative process continues till it learns enough about its environment to get the desired rewards the main steps of reinforcement learning method are mentioned as follows prepare agent with set of initial policies and strategy observe environment and current state select optimal policy and perform action get corr... |
15,795 | we can always train the model on new data but then we would have to add new data samples along with the older historical training data and again re-build the model using this new batch of data if most of the model building workflow has already been implementedretraining model would not involve lot of efforthoweverwith ... |
15,796 | model based learning the model based learning methods are more traditional ml approach toward generalizing based on training data typically an iterative process takes place where the input data is used to extract features and models are built based on various model parameters (known as hyperparametersthese hyperparamet... |
15,797 | figure - the crisp-dm model depicting the data mining lifecycle figure - clearly shows there are total of six major phases in the data mining lifecycle and the direction to proceed is depicted with arrows this model is not rigid imposition but rather framework to ensure you are on the right track when going through the... |
15,798 | define business problem the first task in this phase would be to start by understanding the business objective of the problem to be solved and build formal definition of the problem the following points are crucial toward clearly articulating and defining the business problem get business context of the problem to be s... |
15,799 | define data mining problem this could be defined as the pre-analysis phasewhich starts once the success criteria and the business problem is defined and all the risksassumptions and constraints have been documented this phase involves having detailed technical discussions with your analystsdata scientistsand developers... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.