Skip to main content

Blog

Learn About Our Meetup

5000+ Members

MEETUPS

LEARN, CONNECT, SHARE

Join our meetup, learn, connect, share, and get to know your Toronto AI community. 

JOB POSTINGS

INDEED POSTINGS

Browse through the latest deep learning, ai, machine learning postings from Indeed for the GTA.

CONTACT

CONNECT WITH US

Are you looking to sponsor space, be a speaker, or volunteer, feel free to give us a shout.

Author: torontoai

[D] Undergrad Student Stuck in NLP Forever?

Basically am an undergrad student doing a lot of research work with professors in NLP. Recently had some interviews with companies focused on other things such as robotics and CV and got instantly rejected because “my strengths do not fit what they are looking for”.

This has got me thinking that maybe it was a mistake to focus all my undergrad projects on one field such as NLP? It’s a bit late to diversify as grad school applications are soon. Since I have to choose a supervisor for grad I feel like they will have to be NLP focused as well to accept me, and hence will I be stuck in NLP for masters then eventually PhD and forever? How easy is it to switch focus to another area of ML later on?

Honestly I’m just kind of upset because it appears many companies and jobs are focusing on other areas of ML and AI such as robotics and CV (e.g. autonomous vehicles, etc.) whereas my focus on NLP appears to be significantly less desired.

submitted by /u/AnonMLstudent
[link] [comments]

[D] Neural Network Implementation

Hello reddit,

I’m following this lecture series: https://www.youtube.com/watch?v=SGZ6BttHMPw&list=PL6Xpj9I5qXYEcOhn7TqghAJ6NAPrNmUBH and am trying to implement a neural network from scratch.

This is my forward pass:

res_1 = np.dot(W_1.T, x) + b1

res_1_activation = sigmoid(res_1)

output =
np.dot(W_2.T, res_1_activation) + b2

output_activation = sigmoid(output)

This is my backward pass:

grad_pre_output = -(y[i] - output_activation)

grad_W_2 = np.dot(np.expand_dims(res_1_activation, axis=1),np.expand_dims(grad_pre_output, 1).T)

grad_b2 = np.expand_dims(grad_pre_output, 1)

grad_post_1 = np.dot(W_2, np.expand_dims(grad_pre_output, axis=1))

grad_pre_1 =np.multiply(grad_post_1.T, d_sigmoid(res_1))

grad_W_1 = np.dot(np.expand_dims(x, axis=1), grad_pre_1)

grad_b1 = grad_pre_1.T

W_1 = np.add(W_1, lr * ((grad_W_1) - lamda * 2 * W_1))

W_2 = np.add(W_2, lr * ((grad_W_2) - lamda * 2 * W_2))

b1 = np.add(b1, np.reshape(grad_b1, (grad_b1.shape[0],)))

b2 = np.add(b2, np.reshape(grad_b2, (grad_b2.shape[0],)))

I think this implementation should work, but when I run it for >2 epochs all the output neurons get saturated and always return a value of 1. I tried using L2 regularization but it still saturates. Can anyone please tell me what I am doing wrong?

Any help would be appreciated.

Thank you!

submitted by /u/cronoz30
[link] [comments]

[D] How do you measure the change in dependent variable by a unit change in the independent variable?

Hey all,

Firstly I know it’s a basic question but there are a few constraints that make it interesting.

The problem is as follows – I have the following equation –

a1 * b1 * c1…f1 = x/y

here

x/y is a ratio which can range from 0 to +inf.

a1, b1….f1 are features that are all binary.

I want to measure the change in the ratio( x/y ) due to the presence of a1 feature and similarly for other features as well.

I applied LOG transformation of the equation to convert into sums and applied Linear Regression ( sticking to basics ). The learned weights by the model actually denote the change my output value which can be reduced back by taking Exponent of the weights. However, the results were not good.

I needed help with the following –

  • Are there any other methods by which I can measure such change, like using weights of Linear Regression, etc?
  • Since ratio tends to be from 0 to +inf, applying, is there some other transformation I should prefer?
  • All my features are categorical which were one hot encoded, is there some other encoding that might be preferred in such use case?

It’s a college project that I am needing help with , appreciate any sort help ! 🙂

submitted by /u/amil123123
[link] [comments]

[D] Why are arithmetic operations of latent variables meaningful?

I’ve noticed that in a lot of latent variable models, a lot of authors will perform arithmetic operations on the latent space and show that they have meaning e.g. ‘king – men + woman = queen’ in word2vec, the idea of attribute vectors for VAE, and even linear interpolation for VAEs.

What part of training makes this happen? For concreteness, let’s look at VAEs for the time being, with the usual Gaussian prior. It would seem like linear interpolation in this case could yield bad results, since there’s a good chance that at some point in the interpolation we could pass by a vector of smalll norm, which would be very unlikely to be sampled from a Gaussian in the latent space has high dimension. In fact, some papers even make references to this and use things like SLERP. Nevertheless, the results clearly work. Is there a theoretical justification for why these operations have meaning? Why should we even expect a properly-trained VAE to exhibit these properties?

submitted by /u/TheRedSphinx
[link] [comments]

[D] If you use pandas: which tasks are the hardest for data cleaning and manipulation?

Hi,

I am obsessed with making Data Science in Python faster and many people told me that data cleaning and manipulation are the most tedious tasks in their daily work.

Which are the exact tasks where you spend/lose most of your time when performing data cleaning/manipulation in pandas?

  1. reading in datasets (finding the right separator, dataformat, …)
  2. adjusting the data types of the columns – eg parse datetime, parse to numeric or categoric, others?
  3. removing missing values
  4. finding and removing duplicate values
  5. parsing columns and removing invalid strings?
  6. concatenating datasets
  7. joining multiple tables
  8. creating groupbys and aggregations
  9. filtering and selecting subsets
  10. creating new columns/feature engineering
  11. visualizing the dataset and exploring it
  12. Something else? Did I miss something?

I am planning to collect the best libraries for the tasks (or maybe write a library on my own to fill the missing gaps) in order to make the working process much faster.

I would be grateful for any input

Best,

Florian

submitted by /u/kite_and_code
[link] [comments]

[D] UK Masters VS US Masters for American

Hello, I have seen some form of this question before on this subreddit, but not quite any answers specific to my question.

I have known I wanted to get a masters for quite some time. I am currently a Data Scientist in the DC area, however want to move towards machine learning applied for engineering applications as opposed to business/ enterprise applications.

For a while I have been looking at schools in the United States, such as Maryland, Austin, UIL, Michigan etc. However, the idea of going abroad has been in the back of mind for some time. I studied abroad in Edinburgh, which is where I first studied and acquired a passion for machine learning.

Alongside the cheaper cost of school there, on a more personal level I am anxious about missing out on a chance to experience living in a foreign country again. So I am considering applying to programs at UCL, Imperial and Edinburgh. My one concern is how that will Impact career prospects in my future.

Some more background, I graduated relatively recently. I had a 3.5 GPA with a degree in applied stats and computer science from a fairly well known school (albeit not well known in CS). I have research experience from an internship and expect to be published at some point. I have some long term professional goals, but they may just be pipe dreams, of continuing my growth at one of the well known residency programs but I understand my performance during a masters will impact that likelihood more than the school itself. Also a Ph.D is not off the table, but I think masters would help with finding a program I would appreciate and perform well at.

Tl;Dr will a masters in the UK hinder my chances to return to the US for a career in advanced AI and ML?

Edit: words

submitted by /u/Neilson5
[link] [comments]

Powering a search engine with Amazon SageMaker

This is a guest post by Evan Harris, Manager of Machine Learning at Ibotta. In their own words, “Ibotta is transforming the shopping experience by making it easy for consumers to earn cash back on everyday purchases through a single smartphone app. The company partners with leading brands and retailers to offer offers on groceries, electronics, clothing, gifts, home and office supplies, restaurant dining, and more.”

The technical divisions within high-growth, mid-stage companies are prone to a unique set of challenges.  High on the list for many such companies is building quality applications quickly and effectively.

On the machine learning (ML) team at Ibotta—a mobile app that offers cash back on everyday purchases for millions of users—we have done a good deal of thinking and experimentation on this topic.  I would like to share how we leverage AWS to achieve core functionality, such as search with Amazon SageMaker.

In this post, I discuss the architecture of Ibotta’s search engine and how we use Amazon SageMaker with other AWS services to integrate real-time ML into the search experience of our mobile application. I hope that this post can shorten your search for a feasible solution to the comparable challenges in your organization, no matter the organization size.

Creating a streamlined mobile app experience, complete with a comprehensive and user-friendly search flow, is crucial for our business. Customers searching for deals before shopping must find useful content quickly or they’re liable to give up.

With a dedicated team of search relevancy engineers, ML engineers, designers, and mobile developers, we use as much modern technology as possible to rapidly develop and test new, creative improvements to our search relevancy. We prioritize the use of ML to inject data-driven intelligence into our search engine, pushing us beyond traditional information retrieval techniques.

Foundational search infrastructure

Our core infrastructure for search at Ibotta rests on our app’s array of microservices. Indexed documents live in Amazon Elasticsearch Service, which contains all of the content available to the mobile client at a given point in time. An internal content service talks to this document store on request and provides additional rules-based filtering functionality to ensure that only content available to the user making the request is returned.

The content service can receive input search queries and respond with relevant content, taking other contextual considerations into account. The service uses textbook lucene-style search relevancy techniques to retrieve appropriate content in the Elasticsearch document store.

ML-enhanced search infrastructure

The foundational search infrastructure leaves substantial room for improvement. Ibotta’s search problem space has unique challenges, particularly revolving content. One week, there might be an offer for certain brands in the app and another week they are gone. This is driven by the retailers with whom we partner, as they often want to promote an item only for a limited time.

Additionally, some brands and product categories are not available in the app at all, as we have yet to work with those retailers. We still want to show related content to users when their search queries don’t match exact content in the app. For example, a search for a non-carried brand of coffee should return other coffee brands that match across important attributes (flavor, size, price, etc.).

The solution here is query expansion. This is a common search technique that takes the user’s search query and adds context to it before querying the data store. In one case, we can add value by categorizing the search query in real time, enhancing the content retrieval and sorting algorithm. In other cases, after categorization, we’d like to look up and sort online retailers that specialize in the predicted category and return those as suggestions to the user.

To make these category inferences on-demand in real time, we use Amazon SageMaker. We can easily train models and deploy them as fully managed REST APIs to which internal microservices can make requests. An example request and response looks something like the following code:

Request Response
{
    "term": "organic prepared horseradish"
}

{
    "categories": [
        "Condiments, Sauces & Seasonings",    
        "Sauces"
    ],
    "score": 0.901242
}

We use BlazingText, an algorithm built in to Amazon SageMaker. The supervised version of BlazingText is a powerful, flexible, and easy to use text classification model. Out of the box, we get scalable distributed training, Bayesian hyperparameter optimization, and real-time inference endpoint deployment. We’ve spent substantial time training and deploying our own text classification models for other use cases. We found a lot to like using the built-in Amazon SageMaker model and managed training and deployment service.

In one view, below is the architecture of our ML-enhanced search services architecture. As you’ll see, the querying and retrieval mechanism described above (and captured here as well) is complemented by SageMaker, which provides two distinct value-adds. First, it enables us to categorize the search query to deliver more relevant results, and second, it enables us to provide online retailers whose offerings are relevant to the query.

An additional ML value-add is our UPC barcode scan feature. Users can scan barcodes of consumer products with our app. If purchasing that UPC satisfies an offer, we return exact matches. If there isn’t an exact match, we use an unsupervised text similarity algorithm to find related offers to suggest to the user. If they can get cash back with our app, perhaps they will consider an alternative to the product that they scanned.

With the UPC feature, we know upfront the universe of UPCs for which we potentially have a similarity suggestion. Predictions can be made offline and written to an online data store, from which our services can make low-latency requests in real time. We use a combination of Amazon S3, AWS Lambda, Apache Airflow, and Amazon DynamoDB for this process. We see that addition to our architecture in the following diagram, in which the UPC input becomes a search query against which we execute.

We then get a mix of on-demand and batch ML models used as needed to enhance our search experience. With a broad services toolset, we are able to select the right tool for the job. Our production environment consists of fully managed AWS services, including offline data storage, online data storage, data transfer, and ML services.

Building to scale

When technologists talk about building to scale, they are often referring to horizontal scalability—perhaps something like Amazon S3 for storage or managed Kubernetes for compute. With these services, horizontal scaling is effectively infinite.

However, it’s often also useful to talk about scalability in terms of our ability to add new functionality to our services without overcomplicating any individual service or code base. Using microservices built on top of AWS, we are able to add or upgrade features while imposing minimal risk to the existing ecosystem.

We are also able to compartmentalize ownership, particularly allowing ML engineers to own their own services end-to-end. As long as the API contract doesn’t change, the ML team can iterate on their models independent of any contact with the owners of dependent services. Amazon SageMaker enables developers with basic Python skills and ML knowledge to support production microservices that integrate directly into our stack.

This sets us up for future iterations of our search service architecture that don’t require substantial cross functional efforts:

In this setup, perhaps we migrate our UPC prediction pipeline to an Amazon SageMaker service capable of more advanced feature extraction and inference from UPCs to predict related content. We can also migrate our Elasticsearch document store to sit directly behind the search service for more specialized search-oriented document indexing. Then we solely rely on the content service for rules-based user level filtering.

Finally, an exciting ML use case is learning to rank. After the search service retrieves a candidate set of content, we can use an Amazon SageMaker service to dynamically re-rank content in real time. This can factor in known features about content, personalization, as well as trends and seasonality.

Thanks to AWS, we have architecture that sets us up for success. We compartmentalize project work with simple integration points and ownership is clear and straightforward. ML teams can build simple services that integrate directly with our backend platform, all on top of managed infrastructure.

Conclusion

We study how the tech giants like Airbnb, Etsy, Linkedin, Wayfair, and Pinterest operate their search engines and strive to do the same at Ibotta. We regularly think about how our engineering team is comparatively fractional in size. Yet we are well-equipped to deliver similar experiences with the setup we have: our own microservices on top of AWS. The AWS services that we rely on enable us to do rapid iteration and testing that would otherwise be out of reach or impossibly slow to implement. With AWS as our preferred AI/ML provider and the underpinning of our tech stack, we’re excited about what’s next.

[D] What is the effect of training a system with jumbled up feature vectors?

An idea has been bouncing around my head today, and since I’m not very knowledgeable about ML I want to know if there’s any literature (or common sense from experts) about it.

Lets say we have training examples consisting of (say) two features, color (c) and size (s), such that v1 = [c1, s1], v2 = [c2, s2], and vn = [cn, sn].

What is the effect of training a system with “jumbled” inputs vx, and vy, such that vx = [c1, s2] and vy = [c2, s1]?

My immediate thought is that you can’t really give labels to jumbled training examples (it can’t be a cat if it has a horse’s head and a pig’s tail), but perhaps the system could learn a probability distribution of the labels based on the features included?

Anyway, can jumbled training examples produce a model that is useful in any way? Is there any literature exploring this?

submitted by /u/General_Example
[link] [comments]