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] Momentum updates average of g, e.g. Adagrad also of g^2. What other averages might be worth to update? E.g. 4: of g, x, x*g, x^2 give MSE fitted local parabola

Updating exponential moving average is a basic tool of SGD methods, starting with of gradient g in momentum method to extract local linear trend from the statistics.

Then e.g. Adagrad, ADAM family adds averages of g_i*g_i to strengthen underrepresented coordinates.

TONGA can be seen as another step: updates g_i*g_j averages to model (uncentered) covariance matrix of gradients for Newton-like step.

I wanted to propose a discussion about some other interesting/promising updated averages for SGD convergence e.g. met in literature?

For example updating 4 exponential moving averages: of g, x, gx, x2 gives MSE fitted parabola in a given direction, estimated Hessian = Cov(g,x).Cov(x,x)-1 in multiple directions (derivation). Analogously we could MSE fit e.g. in a single direction degree 3 polynomial if updating 6 averages: of g, x, gx, x2, g*x2, x3.

Have you seen such additional updated averages in literature, especially of g*x? Is it worth e.g. to expand momentum method by such additional averages to model parabola in its direction for smarter step size?

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

[P] Deep Learning on Healthcare Lecture Series (6)

Deep Learning on Healthcare (6): Regulations. I found quite interesting argument in twitter between influential people such as Hugh Harvey, Jeremy Howard and Luke Oakden-Rayner. So I decided to introduce this argument and discuss about the regulation for deep learning in healthcare and medicine for the last lecture theme.

Deep Learning on Healthcare (6)

Deep Learning on Healthcare (5)

Deep Learning on Healthcare (4)

Deep Learning on Healthcare (3)

Deep Learning on Healthcare (2)

Deep Learning on Healthcare (1)

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

[P] Trump, Obama, Jordan Peterson and Neil deGrasse Tyson TTS models sing Straight Outta Compton

This is a great demonstration of some of the different TTS models I’ve trained and how I can control style:

https://www.youtube.com/watch?v=SXTdnk7-2i0

These models were trained using my implementation of the papers “Style Tokens: Unsupervised Style Modeling, Control and Transfer in End-to-End Speech Synthesis” (https://arxiv.org/abs/1803.09017) and “Towards End-to-End Prosody Transfer for Expressive Speech Synthesis with Tacotron” (https://arxiv.org/abs/1803.09047).

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

[D] Observations from OpenAI’s Five (Dota 2)

I’ve been working on writing an article about AlphaStar for a while (cough, very late), but after last week’s events I decided to sit down and write about OpenAI’s 5 success.

There are a few areas I wish I had more knowledge to expand on:

  • I wish I knew more about OpenAI’s Rapid to write about.
  • Pros and Cons of PPO for Dota 2. I’d also like to know what didn’t work.
  • Decision Tree of Starcraft 2 vs OpenAI. Relative to each of the games, OpenAI has solved more of Dota 2’s action space. However, Starcraft 2 seems to have a larger decision tree?
  • OpenAI mentioned “surgery” when thinking of transfer learning, but there isn’t much information out there.

https://senrigan.io/blog/takeaways-from-openai-5

Very open to feedback and suggestions, thanks!

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

[D] GAN Immediate Mode Collapse

I’m not even sure if mode collapse is the correct term; neither the generator nor discriminator is learning anything when I pass both true/false samples to the discriminator. If instead I only show the discriminator true or false samples, the loss drops. I’ve seen mode collapse after a few epochs of training other GANs but never complete stagnation out of the gate. What might be going wrong here?

def generator(): neurons = 121 model = Sequential() # Input shape [batch_size,timestep,input_dim] model.add(LSTM(neurons,activation='tanh',recurrent_activation='hard_sigmoid',kernel_initializer='RandomUniform',return_sequences=True)) model.add(LSTM(neurons,activation='tanh',recurrent_activation='hard_sigmoid',kernel_initializer='RandomUniform',return_sequences=True)) model.add(Dense(1,activation=None)) return model def discriminator(): model = Sequential() # Input shape [batch_size,steps,channels] model.add(Conv1D(32,4,strides=2,activation=None,padding='same',input_shape=(None,1))) model.add(LeakyReLU()) model.add(Conv1D(64,4,strides=2,activation=None,padding='same')) model.add(LeakyReLU()) model.add(BatchNormalization()) model.add(Conv1D(128,4,strides=2,activation=None,padding='same')) model.add(LeakyReLU()) model.add(BatchNormalization()) model.add(Dense(128,activation='relu')) model.add(Dense(1,activation='sigmoid')) return model def generator_containing_discriminator(g, d): model = Sequential() model.add(g) d.trainable = False model.add(d) return model def g_loss_function(y_true,y_pred): l_bce = keras.losses.binary_crossentropy(y_tue,y_pred) l_norm = K.sqrt(K.square(y_true)-K.square(y_pred)) return l_bce+l_norm def train(X,Y,BATCH_SIZE): d_optim = SGD(lr=0.002) g_optim = SGD(lr=0.00004) g = generator() d = discriminator() gan = generator_containing_discriminator(g, d) g.compile(loss=g_loss_function, optimizer=g_optim) gan.compile(loss='binary_crossentropy',optimizer="SGD") d.trainable = True d.compile(loss='binary_crossentropy', optimizer=d_optim) num_batches = int(X.shape[0]/float(BATCH_SIZE)) for epoch in range(1000): for index in range(1,num_batches): # Prepare data startIdx = (index-1)*BATCH_SIZE endIdx = index*BATCH_SIZE inputs = X[startIdx:endIdx,:] targets = Y[startIdx:endIdx] # Generate predictions Y_pred = g.predict(inputs) # Build input and truth arrays for discriminator targets = targets.reshape(BATCH_SIZE,1,1) truth = np.vstack((np.ones((BATCH_SIZE,1,1)),np.zeros((BATCH_SIZE,1,1)))) d_loss = d.train_on_batch(np.vstack((targets,Y_pred)),truth) d.trainable = False # Test GAN g_truth = np.ones((BATCH_SIZE,1,1)) g_loss = gan.train_on_batch(inputs,g_truth) d.trainable = True print('Epoch {} | d_loss: {} | g_loss: {}'.format(epoch, d_loss,g_loss)) g.save_weights('generator',True) d.save_weights('discriminator',True) return d,g,gan 

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

[Project]Deploy trained model to AWS lambda with Serverless framework

Hi guys,

We have continue updating our open source project for packaging and deploying ML models to product (github.com/bentoml/bentoml), and we have create an easy way to deploy ML model as a serverless (www.serverless.com) project that you could easily deploy to AWS lambda and Google Cloud Function. We want to share with you guys about it and hear your feedback.

 

A little background of BentoML for those aren’t familiar with it. BentoML is a python library for packaging and deploying machine learning models. It provides high-level APIs for defining a ML service and packaging its artifacts, source code, dependencies, and configurations into a production-system-friendly format that is ready for deployment.

Feature highlights: * Multiple Distribution Format – Easily package your Machine Learning models into format that works best with your inference scenario: – Docker Image – deploy as containers running REST API Server – PyPI Package – integrate into your python applications seamlessly – CLI tool – put your model into Airflow DAG or CI/CD pipeline – Spark UDF – run batch serving on large dataset with Spark – Serverless Function – host your model with serverless cloud platforms

  • Multiple Framework Support – BentoML supports a wide range of ML frameworks out-of-the-box including Tensorflow, PyTorch, Scikit-Learn, xgboost and can be easily extended to work with new or custom frameworks.

  • Deploy Anywhere – BentoML bundled ML service can be easily deploy with platforms such as Docker, Kubernetes, Serverless, Airflow and Clipper, on cloud platforms including AWS Lambda/ECS/SageMaker, Gogole Cloud Functions, and Azure ML.

  • Custom Runtime Backend – Easily integrate your python preprocessing code with high-performance deep learning model runtime backend (such as tensorflow-serving) to deploy low-latancy serving endpoint.

 

How to package machine learning model as serverless project with BentoML

It’s surprising easy, just with a single CLI command. After you finished training your model and saved it to file system with BentoML. All you need to do now is run bentoml build-serverless-archive command, for example:

 $bentoml build-serverless-archive /path_to_bentoml_archive /path_to_generated_serverless_project --platform=[aws-python, aws-python3, google-python] 

This will generate a serverless project at the specified directory. Let’s take a look of what files are generated.

 /path_to_generated_serverless_project - serverless.yml - requirements.txt - copy_of_bentoml_archive/ - handler.py/main.py (if platform is google-python, it will generate main.py) 

serverless.yml is the configuration file for serverless framework. It contains configuration to the cloud provider you are deploying to, and map out what events will trigger what function. BentoML automatically modifies this file to add your model prediction as a function event and update other info for you.

requirements.txt is a copy from your model archive, it includes all of the dependencies to run your model

handler.py/main.py is the file that contains your function code. BentoML fill this file’s function with your model archive class, you can make prediction with this file right away without any modifications.

copy_of_bentoml_archive: A copy your model archive. It will be bundle with other files for serverless deployment.

 

What’s next

After you generate this serverless project. If you have the default configuration for AWS or google. You can deploy it right away. Otherwise, you can update the serverless.yaml based on your own configurations.

Love to hear feedback from you guys on this.

 

Cheers

Bo

 

Edit: Styling

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

The AWS DeepRacer League triple – Three countries, three races and three new champions!

The AWS DeepRacer League is the first of its kind global autonomous racing league, providing developers of all skill levels with the opportunity to get hands-on with machine learning and have fun doing it.

In another first for the AWS DeepRacer League, the race went truly global on April 17, 2019 as three live racing events got underway on the same day and in three different countries. We crowned three more AWS DeepRacer League champions. They are all heading to re:Invent 2019 on an expenses-paid trip to compete in the AWS DeepRacer Championship Cup final.

Following the sun to crown the champions

The races began in Seoul, South Korea, where developers were eager to get on the tracks in an attempt to beat the current world record set by the Singapore champion, Juv Chan.

Seoul was the second two day event on the summit circuit calendar. At the end of the qualifying rounds on the first day, the bar was set high. Racers then returned on the second day to try and capture the top spot. After the first day, “Steve’s” autonomous vehicle time was just under 10 seconds. He was about eight-tenths of a second from the current world record.

As the first day of racing in Seoul was nearly done, developers began competing in Dubai, UAE. Crowds gathered to watch developers put their skills to the test on the tracks. It was a close race in the top spots, but “Mats @ virgin mobile” emerged victorious with a winning time of 18.078 seconds. He trained his model at home using the Sagemaker RL notebook.

The Top 3 on the podium at Dubai

While the story unfolded in Dubai, the races in Amsterdam, Netherlands got underway. Another high-energy event, more developers gathered in Amsterdam to build, train, and deploy reinforcement learning models to their AWS DeepRacer fleet cars. The winner in Amsterdam, Pon Datalab, came to the summit with his colleagues to learn more about how AWS can improve data science for their business. He registered for a DeepRacer workshop with a few teammates because this was the first time any of them tried to build a machine learning model. When asked what the best part of his day was, Pon Datalab said “Going to the workshop, then working as a team to train our model, then seeing it in action, seeing it in first place was amazing, I cannot believe it!”

The Amsterdam champion “Pon Datalab”

Rounding out the triple with more record lap times

As we crowned the second of three champions, our competitors in Seoul were preparing for a final day of racing. The first day ended with the promise of an exciting day 2, as racers went home setting close to a record lap times and armed with new knowledge of how to improve their models from DeepRacer workshops, and experts at the track. The promise was kept, as 8 of our top 10 broke the 10 second barrier and our top 3 all smashed the previous record of 9.090 with sub 9 second laps!

Although all of our participants had some fantastic performances, there can be only one champion. He was Yejun Kim, who had started building his model 3 days prior to the summit using the SageMaker RL notebook. He attended a workshop and tweaked is racing model based on what he learnt there and improved his lap time each time he raced! His record time was 7.998 seconds!! He is now the AWS DeepRacer world record holder, and is excited to see what he can do when he gets to the finals at re:invent. Watch his winning lap time and listen to his excitement below.

Developers of all skill levels can race for prizes and glory, from anywhere in the world

The global developer community is achieving some amazing lap times. Can you? Whether you are new to machine learning or building on existing skills, you can race with enthusiasm and have fun doing it. Each summit champion is awarded an expenses-paid trip to the finals at re:Invent 2019 in Las Vegas, Nevada. There, the global champions compete for a chance to win the AWS DeepRacer Cup. It doesn’t matter whether you set a world record time or win by learning brand new skills.

Coming soon is the virtual league, where you can compete online through the AWS DeepRacer console. The virtual league gives you the same opportunity to compete and advance to the finals in Las Vegas, whatever continent or country you are in! With tracks varying in difficulty, and exciting themes that will be unveiled each month, the AWS DeepRacer League provides developers the opportunity to succeed.


About the Author

Alexandra Bush is a Senior Product Marketing Manager for AWS AI. She is passionate about how technology impacts the world around us and enjoys being able to help make it accessible to all. Out of the office she loves to run, travel and stay active in the outdoors with family and friends.

 

 

 

 

[Project] Computer Vision with ONNX Models

Hey everyone! I just created a new runtime for Open Neural Network Exchange (ONNX) models called ONNXCV.

Basically, you can inference ONNX models for realtime computer vision applications (i.e. image classification and object detection) without having to write boilerplate code. It is useful in the sense that one can focus on making deep learning models using any deep learning library (that converts models into the ONNX file format), without having to sacrifice time into building the actual inferencing program.

Let me know what you think and if I should continue to build upon this (or not).

Here is the code.

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