TensorFlow 1.0 Coverage   

          TensorFlow/Google: Latest Moves   

          FOSS and Artificial Intelligence   

          TensorFlow   

          Google Cloud Platform : Good Times Ahead   

The tech behemoths Amazon, Microsoft & Google are established players in one of the battes that will change the future of customers view and investments of computing. This is an area with a potential hundred billion dollars plus that can be secured for the vendors – a lucrative space that each one wants to corner : the cloud. For a quick recap of the dollars under consideration - read here. Cloud lets business tap on demand the processing, storage and software over the web. Tall, powerful and cool servers with gargantuan memory onboard installed inside enterprises now are gradually giving way to tap on need model –use when needed and shut them down in other times. The vast data centers and governance brought in by these tech behemoths make them ideal partners for business to tap such services on a need to have basis – whenever and wherever required.

Amazon is by far the well-established leader here with a revenue that far exceeds the combined revenue of all competitors put together. Amazon partly achieved this by bringing a single-minded focus to this space to scale up and win and it paid back handsomely. Amazon’s first-mover advantage coupled with slow reactions from competition has now made Amazon an almost insurmountable lead in business in this space. That’s the focus and attention of the next two players. Microsoft has been pushing Azure extensively last 2-3 years and clocking impressive success. The lesser known of the trio in this space – Google is now flexing its muscle and is now focused on striking it big here. Google is recognized primarily as the early proponent of cloud computing – after all, Google built huge date centers in its early days and ran services like search, gmail and maps , available around the world and with unthinkable scale in action. Alongside, developers build other applications on top resulting in an expanding google universe. Google has the strong reputation of running scalable, secure services and recognized as one delivering successfully for a long time. By being late and remaining indifferent to this space, Google lost out on big time opportunities that were out there and Amazon happily grabbed these. Now, Google wants to get back aggressively and be counted as large player in this space and is increasing its investments, market messaging and outreach efforts. Last week the company hosted an event to talk about their upcoming plans around the Google cloud platform and talk loudly about some notable success that they have notched thus far. I listened to the webcast and followed the announcements keenly to see how Google is planning to move things here and I heard good actionable things.

Google’s overall messaging shows that the momentum in the business continues and the focus to scale this platform with enterprise as a key segment to focus on for adoption. Google positioning is getting better to take a sizable chunk of business in the ever growing public cloud space over the next few years. The overall market is projected to have 50% of the enterprise workloads moved into overtime. Google paraded customers/customer stories – the likes of Spotify, Coca-Cola, Disney etc. as proof of successful adoption of their services.

The emphasis on a move forward basis is positioned around:

A. Machine learning as a cornerstone of their approach and hence drive the attendant benefits for customers.

B. Monetization/Commercialization of native security tools used within Google to make these available to customers.

C. Make ease of deployment and migration more easy.

In terms of upcoming innovation, consistent with its focus on enterprise adoption, Google talked about the lofty vision of No-ops goal for enterprises. This will be an ideal demonstration of the power of cloud computing and if Google and others are able to make it happen everywhere, it’s a true sign of the changed paradigm here.Another important facet of the evolution of the cloud revolved around the extreme emphasis on machine learning and the Google cloud platform’s leverage of this. A new product called Tensorflow has been open sourced by Google and it is their core belief that embracing machine learning will become a non-negotiable for innovative startups focused on scaling globally and offering sophisticated services.Add into the mix cloud monitoring tools working across clouds – enterprises can hardly resist massive cloud adoption with these. And in order to keep helping enterprises adopt and scale faster, Google wants to focus on the three important aspects of cloud computing – data centers, security and containers.

I drilled into these a little more to find what could be differentiated in offering such services and what I could recollect from the conference webcast included the following, which Google finds as the drivers for increasing enterprise adoption of their services.

1. Better value: GCP can cost up to 50% less than competitors. Google provides automatic discounts as customers consume higher volumes. And GCP also offers custom machine types (i.e., cores or gigabytes), which helps save customers versus static instance types from other vendors that often lead to overprovisioning.

2. Accelarate innovation: Google’s approach here is to allow customers to run applications with no additional operations staff needed. For example, Google showcases Snapchat here - grew from zero to 100mn users without hiring an operations team (just two people).

3. Risk Management : Google shall be focused on providing best-in-class security for customer’s data and digital assets, protect privacy and help in conforming to compliance and regulatory needs.

4. Open Source adoption –leading to better management by customers for products like Kubernotes( focused on managing data containers).

I got the feeling that the GCP was comparable to Amazon’s fabled AWS services for the purpose of enterprise adoption. While the engineering and under the hoods battle is one part of the equation, the real determinant of success and also ran lay in shaping market forces – GTM, Solutions, Partnerships, support and ease of doing business – an area that Google will have to heavily focus on. With Google’s stated plans to triple their data center regions and with some good early demonstrated success, the market should begin to warm up for Google.Enterprise success depends not just on what’s available from a service provider – determination of what and how to move to cloud, transforming IT landscape, flipping over the governance model and change management – all these have a say in the eventual success of any cloud initiative. With substantial progress and focus on this space with the tech giants competing aggressively for their pie in this fast growing space, the competition expands the market, services get more sophisticated and yet mature fast and the industry improves and courtesy of Moore’s effect, the customers get superior services at a lower cost. It’s a win-win situation for all.



          用TensorFlow和OpenCV打造实时识别应用   
爱可可-爱生活   网页版 2017-06-28 10:19 视觉 代码 数据科学 【用Tensorflow/ […]
          使用 Go 语言来理解 Tensorflow   

本文通过一个简单的Go绑定实例,让读者一步一步地学习到Tensorflow有关ID、作用域、类型等方面的知识。

使用 Go 语言来理解 Tensorflow,首发于文章 - 伯乐在线


          Nutanix and Google Cloud team up to simplify hybrid cloud   

Today, we’re announcing a strategic partnership with Nutanix to help remove friction from hybrid cloud deployments for enterprises. We often hear from our customers that they’re looking for solutions to deploy workloads on premises and in the public cloud.

Benefits of a hybrid cloud approach include the ability to run applications and services, either as connected or disconnected, across clouds. Many customers are adopting hybrid cloud strategies so that their developer teams can release software quickly and target the best cloud environment for their application. However, applications that span both infrastructures can introduce challenges. Examples include difficulty migrating workloads such as dev-testing that need portability and managing across different virtualization and infrastructure environments.

Instead of taking a single approach to these challenges, we prefer to collaborate with partners and meet customers where they are. We're working with Nutanix on several initiatives, including:

  • Easing hybrid operations by automating provisioning and lifecycle management of applications across Nutanix and Google Cloud Platform (GCP) using the Nutanix Calm solution. This provides a single control plane to enable workload management across a hybrid cloud environment.

  • Bringing Nutanix Xi Cloud Services to GCP. This new hybrid cloud offering will let enterprise customers leverage services such as Disaster Recovery to effortlessly extend their on-premise datacenter environments into the cloud.

  • Enabling Nutanix Enterprise Cloud OS support for hybrid Kubernetes environments running Google Container Engine in the cloud and a Kubernetes cluster on Nutanix on-premises. Through this, customers will be able to deploy portable application blueprints that target both an on-premises Nutanix footprint as well as GCP.

In addition, we’re also collaborating on IoT edge computing use-cases. For example, customers training TensorFlow machine learning models in the cloud can run them on the edge on Nutanix and analyze the processed data on GCP.

We’re excited about this partnership as it addresses some of the key challenges faced by enterprises running hybrid clouds. Both Google and Nutanix are looking forward to making our products work together and to the experience we'll deliver together for our customers.


          人工智能一之TensorFlow环境配置   

          Nutanix and Google Cloud team up to simplify hybrid cloud   

Today, we’re announcing a strategic partnership with Nutanix to help remove friction from hybrid cloud deployments for enterprises. We often hear from our customers that they’re looking for solutions to deploy workloads on premises and in the public cloud.

Benefits of a hybrid cloud approach include the ability to run applications and services, either as connected or disconnected, across clouds. Many customers are adopting hybrid cloud strategies so that their developer teams can release software quickly and target the best cloud environment for their application. However, applications that span both infrastructures can introduce challenges. Examples include difficulty migrating workloads such as dev-testing that need portability and managing across different virtualization and infrastructure environments.

Instead of taking a single approach to these challenges, we prefer to collaborate with partners and meet customers where they are. We're working with Nutanix on several initiatives, including:

  • Easing hybrid operations by automating provisioning and lifecycle management of applications across Nutanix and Google Cloud Platform (GCP) using the Nutanix Calm solution. This provides a single control plane to enable workload management across a hybrid cloud environment.

  • Bringing Nutanix Xi Cloud Services to GCP. This new hybrid cloud offering will let enterprise customers leverage services such as Disaster Recovery to effortlessly extend their on-premise datacenter environments into the cloud.

  • Enabling Nutanix Enterprise Cloud OS support for hybrid Kubernetes environments running Google Container Engine in the cloud and a Kubernetes cluster on Nutanix on-premises. Through this, customers will be able to deploy portable application blueprints that target both an on-premises Nutanix footprint as well as GCP.

In addition, we’re also collaborating on IoT edge computing use-cases. For example, customers training TensorFlow machine learning models in the cloud can run them on the edge on Nutanix and analyze the processed data on GCP.

We’re excited about this partnership as it addresses some of the key challenges faced by enterprises running hybrid clouds. Both Google and Nutanix are looking forward to making our products work together and to the experience we'll deliver together for our customers.


          I/O 2017: Invented w/ Others   
Watch live!

I am so excited the time has come for Google I/O to kick off for the second year in our backyard, with thousands of developers coming to join hundreds of Google engineers as we geek out on tech in a festival atmosphere. I have already been at several pre-events, and what blows me away the most about conferences like this is how international they are. With all that is going on in the world, it feels great to come together as one. An immense amount of work goes into putting on the event, crafting great content for developers, and of course building the products that come to life. This isn’t just about the products that we build at Google, but a ton of partners work incredibly hard to get things ready to showcase platforms and ecosystems.

As I reflect on what I am most proud about this year, one theme is exactly this: working together with partners and ecosystems. We are fortunate enough to have a few large and mature platforms out there such as Android and the Web, and each is still pushing the boundaries and innovating. We also have new platforms and extensions that tie together our own services as well as these ecosystems. I have seen an increased effort to unifying and working together where it makes sense. For example, running Android apps on ChromeOS, running Web apps as first class experiences via PWA, having immersive reality (VR and AR) come to various platforms, and glueing things together with IoT and Actions on Google.

Computing is unbundling, and individual components have more wiggle room and ability to connect and compose with each other. These connections are supported by empowering glue such as Cloud Functions, and machine learning is there to make experiences work optimally for uses. When mobile first hit, much of the UX hit was around coming up with the right interaction on the small device and how it tied into the context it now had about you (from your location to your contacts). Now, the best experiences take that attention to detail, and they marry it with smarter services. Google Photos is a canonical example that has a very nice UI for sure, but the magic is in how I can search for [my son in green when he was four] and get results. Slack has done a great job with their UI, but it was their search functionality that originally won me over from Campfire. It is becoming a given that you should be thinking about how you can best use data to up level your experiences. We have a lot of talks on TensorFlow from beginner to advanced, but we also have many APIs that do the work for you (e.g. vision APIs). You don’t have to take a linear algebra course again to get started (but I recommend this fun way of doing so!).

Not Just Invented Here

I am really excited to hear how Android developers react to the Kotlin announcement today. I have heard developers ask about our support for such as long time, I am really excited to let them know that we are standing by it. I first used Kotlin several years back when I was frustrated at the level of Java language support, and it is a fantastic modern language. Since then the community has grown, and it has broadened its targets. I am so happy that we have embraced this rather than trying to do something new for the sake of it. We have a lot of great information on how to get started.

Beyond Kotlin, we have great new improvements in the tools and SDKs. The new architecture components such as the lifecycle management helpers are going to save so much time (and frustration). Chet, Tor, and Romain are going to have a whale of a time on stage this year showing off all the goodness. This has been the best developer-focused Android release in awhile, and this is just the start for Kotlin and these developer tools.

All boats rising

The Web has always been about community and shared evolution. It is the democracy that, yes requires compromise and working together, but results in shared change that doesn’t give too much power to a particular entity. This year we see the Web innovate faster than ever, resulting in great new experiences such as Twitter’s new PWA that comes in at a tiny bundle to get going quickly and picks up steam from there. And then there is the amazing Wego experience. The story behind that is particularly fun, as an app developer picked up Polymer (2.0 just released!) and two months later had it up and running.

We have new tools to help you take your web experience to the next level. Lighthouse 2.0 was announced and now comes baked into Chrome DevTools, and Workbox takes our battle tested sw-toolbox and sw-precache and packages it in a nicer bundle that lets you pick and choose what you want to bring service workers to your app. But again, it isn’t about what we are doing. Microsoft talked about their support for PWAs at Build last week, and other browser vendors are working with us to support the latest and greatest as soon as possible. Outside of the browsers, the framework and app developers are busy working on how to optimize for the constraints and opportunities of mobile, whilst also getting their support to desktop and other (sometimes surprising!) form factors. The Web continues to be about reaching out to all of your users and meeting them where they are.

We built a fun Google I/O action!

Reaching the full bundle

As the mature platforms continue to push the bar, we are seeing other form factors come to life too. Whether it be Actions on Google that can reach users through their Google Home, phones (and more!) giving you multi-modal access to services at the flick of a voice or text gesture, immersive new VR and AR experiences, or Android Things packaging IoT in a manner that makes it incredibly approachable and powerful.

Bringing it together

This year we brought Fabric together with Firebase, and today we are open sourcing more of the product (with more coming!) right as we add new functionality across the platform, including large new initiatives such as Firebase Performance.

What I love about Firebase is how it brings you the best tools to help you build your applications, all packed with a top notch API console and SDKs that work together.

This is all the tip of the iceberg. Unifying the unbundle, together is the cheesiest thing I have written in some time, but that is what I see when I look at where things are coming together this year. All platforms innovating quickly, but coming together where it makes sense to solve problems.

All the prep is done, now the fun part…. getting to meet old friends and new at Google I/O.

If you can’t be here in person or at an I/O Extended event, please tune in, and we are bringing more Google Developer Days to you this year!

“platforms innovate
together computing unbundles
and then we all unify.” — Stephen Colbert

I/O 2017: Invented w/ Others was originally published in Ben and Dion on Medium, where people are continuing the conversation by highlighting and responding to this story.


          The Unbundling of Mobile   

The Unbundling of Mobile is Happening

I happily pay Ben Thompson to read his daily thoughts on Stratechery. Not only do I enjoy seeing his thought process unfold, but I also have a really soft spot for someone who has been able to get direct to his customers, finding a niche that allows him to just do his thing, and be successful along the way. This is one of the great enablers of the Internet era. Because we have broken many of the borders, or distribution friction, we are able to see niche areas go deep and do well. This unbundling is fantastic for diversity. Without this we need to aggregate and then popularism naturally forces the hand on what content gets shared the most and touches people.

Ben talks a lot about this topic itself, and often points to Marc Andreessen’s old chestnut that there are “only two ways to make money in business: One is to bundle; the other is unbundle”. The pendulum swings, and those who get to the other side quickly can benefit from that momentum.

We are currently witnessing the unbundling of mobile, and it is fascinating to see people try to understand how deeply the pendulum will swing and where to get ready to add value to the ecosystem. I feel like a broken record when I remind myself and others how long mobile took to take off. It was The Big Thing tm at JavaOne for many years before it was.

You remember when…

  • the networks were slow and atrocious (and WAP? nuff said)
  • screens were tiny and low quality (and when we got to touch screens they were far from feeling like they do today)
  • input was often painful (as great as T9 was for those who assimilated it, and as great as hardware keyboards were).

We could keep going on, but man, it was bad. It just took time for all of the evolution to get good enough, and when it did, it clicked.

I really enjoyed seeing yet another view of just how big it was, and is. Just compare it to the other revolutions in computing:

Mobile is up up up up up and to the right

We bundled computing, communications (phone, texting => social), entertainment (media) and the hitch hikers guide to the galaxy (The Web) all together. You can carry it all around in your pocket with a usable screen and input that keeps getting better.

This is a popular bundle and it is still growing. We are also seeing attempts to unbundle again, in a phased way.

Remember when the desktop was the “digital hub” in the home? iTunes on a computer was the source of truth, and other devices could tether and untether. This has now been taken over by either mobile devices or the cloud itself. The most literal example here is with watches. The first version of watches required your mobile device, and over time this changed (NOTE: Wear 2.0 just launched!) This is critical. One of the great uses of wearables is fitness, and you don’t want to have to run with a watch AND your device.

So, what are we unbundling here?

  • Compute: it makes sense to have a system that can do “enough” itself, but can also use compute from other parts of the system (watch using mobile, mobile using desktop, everything using cloud :) A really important part of this is bringing the power of ML to where you need it to be. As our best experiences all use ML somewhere, we need progressive ML enhancement, including being able to run some of this offline (e.g. TensorFlow crunching in the cloud => run detection locally on device)
  • Network: not having to go through your mobile device only, and also using the power of P2P (you see amazing examples of this in areas of the world with really weak and expensive networks)
  • Input and Output: This is huge. We are breaking out of touch screens of a certain size and virtual keyboards to include voice (including ambient), wearables, and optimized form factors.

After platforms have done the heavy lifting to break the bundle apart it unleashes even more opportunities. As you build product, your constraints are changed and the levels of context compound to let you do amazing things. Sometimes this comes via quick access for power:

  • “Hey Google, if you notice that I fall asleep can you pause my media?”
  • “… please reset my ad id once a month”
  • “… make sure my garage door is closed after 10pm”
  • “… how often did Wendy come over in February?”

At other times it is joining multiple modes together (I have talked about this in the past) and being able to naturally morph between voice and screen access. We do tend to use our senses together. One of my complaints about some voice UI is that it forces me to close my eyes and put my hands behind my back, and surely we will be able to do better.

The platforms need to be broken up to allow for this, and this brings us to hardware and software…

Hardware Unbundling

How do we enable breaking up the phone into various pieces, and also allow bundling up those packages? This is where IoT comes to play. With Android Things I get to see teams morph and bundle in front of my very eyes, and it is exciting to see when they stick. I know that it is early days, but this is an area that in aggregate will clearly scale massively on the Internet.

Software Unbundling

We talk about unbundling and bundling in software all the time. With the desktop Web we bundled experience delivery where one web app could reach a massive audience. But then, when it came to unbundling with mobile, many companies didn’t have nice APIs with the web clients sitting in front. This allowed for translation engines such as usablenet and moovweb to come in to offer the quick fix to get you going with mobile. This allowed many of us to have a beer and laugh about the old times…. “do you remember when we went in and had to hack a layer of Struts Actions to output JSON instead of HTML? Man that was a brittle POS!” There was a lot of pain and a lot of money to be made as the industry tried to turn a tight corner as quickly as possible, and the long tail is probably only half way through that corner!

As we lean into the unbundling, do you have the right pieces in place to enable high quality experiences to be built for your users in short order? Do you know your business and use cases well enough to know which context are king for you, and how to best reach them all?

We may not know the exact details of the future graph. How large will the overall ecosystems become? It is hard to compare to mobile, but your niche may still be a massive opportunity. It is also humbling to realize that on one side the numbers that we considered to be massive hits were tiny back in the day (millions vs. billions) and on the other, global mobile growth is still far from done.


The Unbundling of Mobile was originally published in Ben and Dion on Medium, where people are continuing the conversation by highlighting and responding to this story.


          NutanixがGoogle Cloudと連携、複数の切り口でハイブリッドクラウドを実現へ   

Nutanixは2017年6月28日(米国時間)、Nutanix .NEXT Conference 2017で、Google Cloudとのパートナーシップを発表した。NutanixはGCPのデータセンターを借りてクラウドサービスを提供、さらにKubernetes、TensorFlowなどで協業する。


          Линки на интересное в сети   
AI https://www.tensorflow.org/ https://github.com/karpathy/neuraltalk2 Полезный софт и утилиты Synergy lets you easily share your mouse and keyboard between multiple computers on your desk Обучение MIT Open Open Source Society University www.coursera.org MIT Challenge Java Шпаргалка Java-программиста 5. Двести пятьдесят русскоязычных обучающих видео докладов и лекций о Java Шпаргалка Java программиста 2: Триста пятьдесят самых популярных не […]
          NutanixがGoogle Cloudと連携、複数の切り口でハイブリッドクラウドを実現へ   

Nutanixは2017年6月28日(米国時間)、Nutanix .NEXT Conference 2017で、Google Cloudとのパートナーシップを発表した。NutanixはGCPのデータセンターを借りてクラウドサービスを提供、さらにKubernetes、TensorFlowなどで協業する。


          تبدیل آنلاین طراحی چهره به عکس واقعی با هوش مصنوعی   
فرض کنید یک طرح ساده از چهره بکشید با یک دکمه آن را به عکس واقعی تبدیل کنید ! این کار هیجان انگیز را تیم هلندی NPO انجام داده است و نام آ نرا Pix2Pix گذاشته است. این ابزار که بر پایه پلتفرم متن باز یادگیری ماشین گوگل بنام Tensorflow ایجاد شده است ، از هوش مصنوعی استفاده می کند و توسط هزاران تصویر تغذیه شده است تا تصاویر خروجی مناسبی ارائه دهد. خروجی نهایی این آزمایش NPO یک برنامه تحت وب بوده است که تلاش می کند خطوطی که شما کشیده اید ، بوسیله تصاویری که رد حافظه خود دارد ترکیب کند و
          成長路線に乗ったルネサスDevCon   

「一度、地獄を見たものは強い」。ルネサスエレクトロニクスの開発者会議であるDevCon(図1)を見た感想だ。半導体チップは言うまでもなくITがけん引する。特にITの今の4大トレンドである、AI(人工知能)、IoT(インターネットにつながる全てのハード)、クラウド、5G(第5世代のセルラー通信)を意識した発表が中心であり、世界の半導体産業と同じベクトルを向いている。狙う市場はもちろん海外が主戦場となる。クルマの新規獲得した2016年度(最初の9ヵ月のみ)の受注金額の70%が海外だという。

 

DSCN4377.JPG

1 ルネサスが先日開催したDevCon 基調講演開演直前の会場は満員

 

 これまでクルマのエレクトロニクスでは自動運転やADAS(先端ドライバ支援システム)では欠かせない自動認識、それに使うAI(人工知能)技術は常識になった。これをルネサスは一般工業用途にも持ってくる。それを組み込みAIとしてe-AIと呼んだ。e-AIはあらゆる組み込みシステム、つまりIoTシステムで工業用途での自動機や産業ロボットを学習させ、賢く自律的に判断させるのにAIは欠かせない。

  工業用IoTでは、全てのデータをクラウドへ上げる訳ではない。さほど大きくないデータ量をリアルタイムで処理しなければならない場合には、むしろセンサを備えたIoT端末(エッジ)が置かれたローカルで処理することが多い。もちろん、5G時代が到来すれば、クラウドでさえ、低いレイテンシ(時間遅れ)を実現できるが、今使うにはやはりローカルな処理が求められる。この処理こそ、e-AIが能力を発揮する。

  IoTシステムの中でデータ解析をするツールとしてAIは今や常識になってきた。工業用IoTデバイスをプラント内の配管や装置の近くに設置し、IoTからのデータを集めそれをAIで解析することで機械の予防保全に利用したり、機械のスループットを上げたりする。生産性を上げればIndustry 4.0となり、機械のデータをARなどデジタルで見られればデジタルツインになる。もはやIoTAIはセットになってきたともいえそうだ。

  ルネサスが意図するe-AIでは、学習はクラウドで行い、推論をエッジで行う。ルネサスはインテルとは違い、演算リッチのハイエンドプロセッサを持っていない。ハイエンドマイコンやSoCは得意であり、これらは現場(エッジ)で使うのに向いている。だからこそ、ルネサスの得意な半導体チップを推論用に使い、高度の演算が必要な学習はクラウドで対応する。クラウド上で使ったCaffeTensorflowソフトウエア言語で書いた学習データをマイコンに焼き付けられるように変換するツールとその検証ツールを用意している。さらに、別のところから学習させたデータも取り込めるようにインポートツールも用意した。

  日本の半導体企業の中でAIチップを開発しているところはまだ少なく、インテルやエヌビディア、IBMなどAIを積極的に進めている半導体企業とは違っていた。今回、ルネサスは世界の勝ち組と同様のメガトレンドをうまくとらえており、AIでの成長を見込んでいる。しかもルネサスならではのAIへのアプローチを採った。

FigReneNewOrders.png

 

2 クルマ分野の新規商談金額の推移 すぐに売り上げに反映されないが4~5年後には間違いなく売り上げは増加しそうだ 出典:ルネサスエレクトロニクス

 

 また、クルマ用のマイコンR-Car RH850の商談は順調に伸びており、2016年度はまだ9カ月目の段階で2015年度の新規商談の金額を超え、6500億円を突破した(図2)。今や絶好調と言えるレベルにまで上がってきた。クルマ用半導体は開発完了してから実際のクルマに搭載されるまで5年かかるため売り上げに反映されるにはまだ時間はかかるが、ルネサスの未来は明るくなった。

  かつてルネサスは、リーマンショック後の売上の落ち込み・大幅赤字と、自己資本比率が10%を切る寸前まで落ち込んだ。まさに地獄だった。経営陣の刷新を図り、以来、再建の道を歩んできた。四半期ベースでは10数期連続営業黒字が続いている。

  かつて地獄を見たルネサスは、着々と回復するどころか、成長路線に飛び乗った。社員の顔色も良い。DevConで話を聞いたルネサスの社員たちは、自分の仕事を積極的に説明してくれた。とても全てを紹介できないが、SiCよりもコストが1ケタ低いシリコンのIGBTパワートランジスタを使いながら、電力効率を高め弁当箱大のインバータを実現したり、わずか5mm角程度のICパッケージに入ったパワーMOSトランジスタで30A3相モータを駆動したりする展示もあった。喜々として説明してくれる態度からはルネサスの未来が見えた。

  日立製作所、NEC、三菱電機という親会社からほぼ完全に独立し、自らの責任で自らの道を歩むルネサスに変わった。産業革新機構というファンドの援助があり、外部から経営の専門家が会社を率いたやり方こそ、グローバル企業のやり方でもある。半導体に限らず、日本のIT/電機企業の手本になる日も近い。さて、「優秀なお坊ちゃん企業」東芝はどうするつもりなのか。

                             (2017/04/13


          PAI分布式机器学习平台编程模型演进之路   

PAI分布式机器学习平台编程模型演进之路

在云栖计算之旅第5期—大数据与人工智能大会上,来自阿里云大数据事业部的九丰分享了《PAI分布式机器学习平台编程模型演进之路》。他主要介绍了在集团中使用机器学习解决大数据问题时如何通过编程模型的演进逐步解决业务上的痛点。其中,他只要分享了MapReduce、MPI、Parameter Server编程模型的演进过程。

以下内容根据大会视频整理而成。

什么是PAI?

PAI的全称是Platform of Artificial Intelligence,主要在使用机器学习做模型训练时提供整套链路。机器学习即服务,把机器学习作为服务对外推出,大家可以在平台上使用比较先进的机器学习算法。将多种深度学习框架集成到PAI中,同时基于深度学习框架包装成更加易用的组件。具备异构的计算服务能力,把CPU计算能力和GPU计算能力统一调度起来,异构的计算能力透明,大家的注意力是哪些机器学习算法可以帮助业务,不用关心底层资源的申请和分配。PAI也支持在线预测服务,模型一键发布。

大规模分布式机器学习的挑战

数据规模和特征会不断增加,这就会导致模型复杂度的增加,之前的模型已经不能够处理这么高的复杂度了。特征增加之后,模型变得越来越大,模型很难做到单机加载,所以在模型存储时需要做分片和切分。在常规的机器学习里面,更多的注意力放在理解业务的数据、特征,而现在的注意力会转移到模型本身,更多考虑怎么通过调整模型的结构达到更好的预测效果。

编程模型演进

MapReduce编程模型


PAI分布式机器学习平台编程模型演进之路

MapReduce核心的思想是分而治之,即把数据切分成很多块,每个节点处理其中的一小块。做分布式系统时会面临很多问题,比如希望计算任务可以在MapReduce框架层面做切分和调度。MapReduce从框架层面极大地降低了把任务迁移到分布式计算系统上的难度和门槛。对于数据的分布式存储和划分,数据可分散存储在几千台机器上,并且都有相应副本,不需要担心数据的丢失,底层的分布式存储会统一进行处理。计算任务的同步和计算节点的容错与恢复,若使用普通机器去搭大型计算群的时候,机器的宕机时比较普遍的现象,使用MapReduce则不需要关心这一点。右图是MapReduce的编程模型,最初是用来处理SQL等问题。


PAI分布式机器学习平台编程模型演进之路

在机器学习里面,有些算法是基于MapReduce编程模型去实现的。TF-IDF用来评估文档里面单词是否能表示文档主题。首先计算文档里面单词出现的频率,把谓词和叹词去掉,关注真正有意义的词。IDF则是统计该词在所有文档里面出现的频率,将其和文档里出现的频率经过算法计算得出最终结果。这个过程如何通过MapReduce实现呢?在Mapper中迭代的去加载每一篇要训练的文章,在迭代过程中统计每个单词出现的频率。将统计结果放入Reducer中,进行计算,得到TF-IDF结果表。

MapReduce编程模型有两个特点:不同计算任务之间独立,每个Mapper和Reducer只会计算自己相关的数据,数据并行度高;适合不需要不同节点通信的机器学习算法。

MPI编程模型


PAI分布式机器学习平台编程模型演进之路

逻辑回归算法是需要节点间进行通信的,该算法在个性化推荐中可以经常看到。个性化推荐算法是指每个人点击进来之后会进行分类,判断是否会对某些商品感兴趣,然后进行推荐。模型函数如上图中公式所示,定义损失函数,损失函数值越小说明模型拟合越好,寻找损失函数最小值的过程中用到了梯度下降算法。

早期,很多逻辑回归算法都是基于MPI编程模型实现的,MPI是消息传递接口,定义了Send,Receive,BC阿斯图,AllReduce接口,支持单机多Instance和多机多Instance,具有高度灵活,描述能力强,大量用于科学计算。


PAI分布式机器学习平台编程模型演进之路

MPI使用时有很多限制,首先必须提前知道阶段任务在哪些计算节点上做。在大规模的计算集群里面,所有资源的分配都是动态的,在任务执行之前不知道任务会调度到哪些节点上,但是早期有很多算法需要基于MPI实现,所以对MPI底层做了网络拓扑的建立,做了大量的重构,帮助MPI相关程序能够基于分布式的调度系统调度起来。


PAI分布式机器学习平台编程模型演进之路

逻辑回归的实现过程如上图所示。其中,有n个计算节点,首先会加载训练样本,计算梯度,然后本地加和,最后调用AllReduce接口去计算现在模型所在的位置。MPI本身还存在一些缺点:首先MPI中Worker的数目有上限,当需要更多节点的时候会发生性能下降。

参数服务器Parameter Server


PAI分布式机器学习平台编程模型演进之路

Parameter Server和MPI相比,在更高的层次定义了编程模型和接口。Parameter Server中有三个角色,Server节点用来存储模型,计算节点会加载部分模型、训练数据,每轮迭代时每个节点会计算下个梯度,将节点和Server进行通信。Coordinator用来判断训练是否结束。此外,Parameter Server支持异步通信接口,不需要在不同计算节点间做同步。


PAI分布式机器学习平台编程模型演进之路

阿里在2014年下半年,独立自研了PAI Parameter Server计算模型,已在集团内大规模使用。具体做的工作如上图所示。MPI的一个缺点是不支持容错,而每天上万台的集群会出现各种各样的故障,PAI Parameter Server针对大规模集群做了节点容错功能。Parameter Server集成很多算法,比如逻辑回归等。

深度学习
PAI分布式机器学习平台编程模型演进之路

深度学习是人工神经网络的延伸,相比之下能够支持更深的网络。上图中,Alexnet是卷积神经网络,总共有8层网络,深度学习如果想要获得更好的效果,必须要构建一个更深的神经网络。随着神经网络变深,需要更多的参数,并且模型也会更加庞大。多级训练则需要更高量级的通信量。

TensorFlow


PAI分布式机器学习平台编程模型演进之路

TensorFlow是谷歌第二代的深度学习框架,支持各种神经网络,具有高度的灵活性,丰富的社区生态,支持CNN、RNN、LSTM等网络。

上图中TensorFlow的例子是两层神经网络做图片的分类。上面通过API定义训练图片和测试数据,接着定义了模型(softmax多分类模型),定义损失函数通过交叉熵来做,最后选择优化函数找最优点。下面部分则是通过API把训练数据喂给模型再计算当前模型的准确率。从上例中,可以看出,API非常灵活,基于python,所以非常方便。

PAI TensorFlow

将TensorFlow迁移到PAI上之后,将TensorFlow作业服务化,起TensorFlow作业的时候不需要去申请资源、做训练数据的迁移;分布式调度(包括单机和多机)只需提交模型训练Python文件;GPU卡映射;多种数据源,结构化数据和非结构化数据都支持;超参支持,训练模型时会调整学习率,通过超参把参数存进来就不需要每次都调整了;模型在线预测,训练好模型之后可以部署到在线预测服务上,调用API获知模型结果是否正面。

PAI Pluto(多机多卡Caffe)


PAI分布式机器学习平台编程模型演进之路

Caffe早于TensorFlow,Caffe可以认为是第一代的深度学习框架,使用Caffe时需要通过配置文件配置深度学习的卷积神经网路。目前,很多关于图像的应用都是基于Caffe来做的,使用CNN的网络,比如身份证识别、驾照识别等。其缺点是单机,当训练样本多的时候训练时间非常长。将Caffe底层嫁接到OpenMPI通信框架上,可以支持多机Caffe,能够达到线性加速比。

总结
PAI分布式机器学习平台编程模型演进之路

前文提到了PAI上支持的各种编程模型,在公有云上希望把机器学习作为一个服务推出来,包括数据上传、数据清洗、特征工程、模型训练、模型评价。这样就可以在PAI上做一站式的模型训练和预测。

End.

转载请注明来自36大数据(36dsj.com):36大数据 PAI分布式机器学习平台编程模型演进之路


          分分钟带你杀入Kaggle Top 1%   

分分钟带你杀入Kaggle Top 1%

作者:吴晓晖

不知道你有没有这样的感受,在刚刚入门机器学习的时候,我们一般都是从MNIST、CIFAR-10这一类知名公开数据集开始快速上手,复现别人的结果,但总觉得过于简单,给人的感觉太不真实。因为这些数据太“完美”了(干净的输入,均衡的类别,分布基本一致的测试集,还有大量现成的参考模型),要成为真正的数据科学家,光在这些数据集上跑模型却是远远不够的。而现实中你几乎不可能遇到这样的数据(现实数据往往有着残缺的输入,类别严重不均衡,分布不一致甚至随时变动的测试集,几乎没有可以参考的论文),这往往让刚进入工作的同学手忙脚乱,无所适从。

Kaggle则提供了一个介于“完美”与真实之间的过渡,问题的定义基本良好,却夹着或多或少的难点,一般没有完全成熟的解决方案。在参赛过程中与论坛上的其他参赛者互动,能不断地获得启发,受益良多。即使对于一些学有所成的高手乃至大牛,参加Kaggle也常常会获得很多启发,与来着世界各地的队伍进行厮杀的刺激更让人欲罢不能。更重要的是,Kaggle是业界普遍承认的竞赛平台,能从Kaggle上的一些高质量竞赛获取好名次,是对自己实力极好的证明,还能给自己的履历添上光辉的一笔。如果能获得金牌,杀入奖金池,那更是名利兼收,再好不过。

Kaggle适用于以下人群:

我是小白,但是对数据科学充满求知欲。 我想要历练自己的数据挖掘和机器学习技能,成为一名真正的数据科(lao)学(si)家(ji)。 我想赢取奖金,成为人生赢家。 0 简介

Kaggle创办于2010年,目前已经被Google收购,是全球顶级的数据科学竞赛平台,在数据科学领域中享有盛名。笔者参加了由Quora举办的Quora Question Pairs比赛,并且获得了前1%的成绩(3307支队伍)。这是笔者Kaggle首战,所以写下此文来系统化地梳理比赛的思路,并且和大家分享我们参赛的一些心得。

Quora Question Pairs是一个自然语言(NLP)比赛,比赛的题目可以简单地概括为“预测两个问句的语义相似的概率”。其中的样本如下:


分分钟带你杀入Kaggle Top 1%

也许是作为Kaggle上为数不多的NLP比赛,这看似简单的比赛却吸引了众多的参赛队伍。由于这是NLP问题,所以接下来的介绍都会偏向于NLP,本文会分为以下三个部分:

打Kaggle比赛的大致套路。(比赛篇) 我们队伍和其他出色队伍的参赛经验。(经验篇) 完成Kaggle比赛需要学会哪些实用的工具。(工具篇) 1 比赛篇

为了方便,我们先定义几个名词:

Feature
特征变量,也叫自变量,是样本可以观测到的特征,通常是模型的输入Label
标签,也叫目标变量,需要预测的变量,通常是模型的标签或者输出Train Data
训练数据,有标签的数据,由举办方提供。 Test Data
测试数据,标签未知,是比赛用来评估得分的数据,由举办方提供。 Train Set
训练集,从Train Data中分割得到的,用于训练模型(常用于交叉验证)。 Valid Set
验证集,从Train Data中分割得到的,用于验证模型(常用于交叉验证)。 1.1 分析题目

拿到赛题以后,第一步就是要破题,我们需要将问题转化为相应的机器学习问题。其中,Kaggle最常见的机器学习问题类型有:

回归问题 分类问题(二分类、多分类、多标签)
多分类只需从多个类别中预测一个类别,而多标签则需要预测出多个类别。

比如Quora的比赛就是二分类问题,因为只需要判断两个问句的语义是否相似。

1.2 数据分析(Data Exploration)

所谓数据挖掘,当然是要从数据中去挖掘我们想要的东西,我们需要通过人为地去分析数据,才可以发现数据中存在的问题和特征。我们需要在观察数据的过程中思考以下几个问题:

数据应该怎么清洗和处理才是合理的? 根据数据的类型可以挖掘怎样的特征? 数据中的哪些特征会对标签的预测有帮助? 1.2.1 统计分析

对于数值类变量(Numerical Variable),我们可以得到min,max,mean,meduim,std等统计量,用pandas可以方便地完成,结果如下:


分分钟带你杀入Kaggle Top 1%

从上图中可以观察Label是否均衡,如果不均衡则需要进行over sample少数类,或者down sample多数类。我们还可以统计Numerical Variable之间的相关系数,用pandas就可以轻松获得相关系数矩阵


分分钟带你杀入Kaggle Top 1%

观察相关系数矩阵可以让你找到高相关的特征,以及特征之间的冗余度。而对于文本变量,可以统计词频(TF),TF-IDF,文本长度等等,更详细的内容可以参考这里

1.2.2 可视化

人是视觉动物,更容易接受图形化的表示,因此可以将一些统计信息通过图表的形式展示出来,方便我们观察和发现。比如用直方图展示问句的频数:


分分钟带你杀入Kaggle Top 1%

或者绘制相关系数矩阵:


分分钟带你杀入Kaggle Top 1%

常用的可视化工具有matplotlib和seaborn。当然,你也可以跳过这一步,因为可视化不是解决问题的重点。

1.3 数据预处理(Data Preprocessing)

刚拿到手的数据会出现噪声,缺失,脏乱等现象,我们需要对数据进行清洗与加工,从而方便进行后续的工作。针对不同类型的变量,会有不同的清洗和处理方法:

对于数值型变量(Numerical Variable),需要处理离群点,缺失值,异常值等情况。 对于类别型变量(Categorical Variable),可以转化为one-hot编码。 文本数据是较难处理的数据类型,文本中会有垃圾字符,错别字(词),数学公式,不统一单位和日期格式等。我们还需要处理标点符号,分词,去停用词,对于英文文本可能还要词性还原(lemmatize),抽取词干(stem)等等。 1.4 特征工程(Feature Engineering)

都说特征为王,特征是决定效果最关键的一环。我们需要通过探索数据,利用人为先验知识,从数据中总结出特征。

1.4.1 特征抽取(Feature Extraction)

我们应该尽可能多地抽取特征,只要你认为某个特征对解决问题有帮助,它就可以成为一个特征。特征抽取需要不断迭代,是最为烧脑的环节,它会在整个比赛周期折磨你,但这是比赛取胜的关键,它值得你耗费大量的时间。

那问题来了,怎么去发现特征呢?光盯着数据集肯定是不行的。如果你是新手,可以先耗费一些时间在Forum上,看看别人是怎么做Feature Extraction的,并且多思考。虽然Feature Extraction特别讲究经验,但其实还是有章可循的:

对于Numerical Variable,可以通过线性组合、多项式组合来发现新的Feature。 对于文本数据,有一些常规的Feature。比如,文本长度,Embeddings,TF-IDF,LDA,LSI等,你甚至可以用深度学习提取文本特征(隐藏层)。 如果你想对数据有更深入的了解,可以通过思考数据集的构造过程来发现一些magic feature,这些特征有可能会大大提升效果。在Quora这次比赛中,就有人公布了一些magic feature。 通过错误分析也可以发现新的特征(见1.5.2小节)。 1.4.2 特征选择(Feature Selection)

在做特征抽取的时候,我们是尽可能地抽取更多的Feature,但过多的Feature会造成冗余,噪声,容易过拟合等问题,因此我们需要进行特征筛选。特征选择可以加快模型的训练速度,甚至还可以提升效果。

特征选择的方法多种多样,最简单的是相关度系数(Correlation coefficient),它主要是衡量两个变量之间的线性关系,数值在[-1.0, 1.0]区间中。数值越是接近0,两个变量越是线性不相关。但是数值为0,并不能说明两个变量不相关,只是线性不相关而已。

我们通过一个例子来学习一下怎么分析相关系数矩阵:


分分钟带你杀入Kaggle Top 1%

相关系数矩阵是一个对称矩阵,所以只需要关注矩阵的左下角或者右上角。我们可以拆成两点来看:

Feature和Label的相关度可以看作是该Feature的重要度,越接近1或-1就越好。 Feature和Feature之间的相关度要低,如果两个Feature的相关度很高,就有可能存在冗余。

除此之外,还可以训练模型来筛选特征,比如带L1或L2惩罚项的Linear Model、Random Forest、GDBT等,它们都可以输出特征的重要度。在这次比赛中,我们对上述方法都进行了尝试,将不同方法的平均重要度作为最终参考指标,筛选掉得分低的特征。

1.5 建模(Modeling)

终于来到机器学习了,在这一章,我们需要开始炼丹了。

1.5.1 模型

机器学习模型有很多,建议均作尝试,不仅可以测试效果,还可以学习各种模型的使用技巧。其实,几乎每一种模型都有回归和分类两种版本,常用模型有:

KNN SVM Linear Model(带惩罚项) ExtraTree RandomForest Gradient Boost Tree Neural Network

幸运的是,这些模型都已经有现成的工具(如scikit-learn、XGBoost、LightGBM等)可以使用,不用自己重复造轮子。但是我们应该要知道各个模型的原理,这样在调参的时候才会游刃有余。当然,你也使用PyTorch/Tensorflow/Keras等深度学习工具来定制自己的Deep Learning模型,玩出自己的花样。

1.5.2 错误分析

人无完人,每个模型不可能都是完美的,它总会犯一些错误。为了解某个模型在犯什么错误,我们可以观察被模型误判的样本,总结它们的共同特征,我们就可以再训练一个效果更好的模型。这种做法有点像后面Ensemble时提到的Boosting,但是我们是人为地观察错误样本,而Boosting是交给了机器。通过错误分析->发现新特征->训练新模型->错误分析,可以不断地迭代出更好的效果,并且这种方式还可以培养我们对数据的嗅觉。

举个例子,这次比赛中,我们在错误分析时发现,某些样本的两个问句表面上很相似,但是句子最后提到的地点不一样,所以其实它们是语义不相似的,但我们的模型却把它误判为相似的。比如这个样本:

Question1: Which is the best digital marketing institution in banglore? Question2: Which is the best digital marketing institute in Pune?

为了让模型可以处理这种样本,我们将两个问句的最长公共子串(Longest Common Sequence)去掉,用剩余部分训练一个新的深度学习模型,相当于告诉模型看到这种情况的时候就不要判断为相似的了。因此,在加入这个特征后,我们的效果得到了一些提升。

1.5.3 调参

在训练模型前,我们需要预设一些参数来确定模型结构(比如树的深度)和优化过程(比如学习率),这种参数被称为超参(Hyper-parameter),不同的参数会得到的模型效果也会不同。总是说调参就像是在“炼丹”,像一门“玄学”,但是根据经验,还是可以找到一些章法的:

根据经验,选出对模型效果影响较大的超参。 按照经验设置超参的搜索空间,比如学习率的搜索空间为[0.001,0.1]。 选择搜索算法,比如Random Search、Grid Search和一些启发式搜索的方法。 验证模型的泛化能力(详见下一小节)。 1.5.4 模型验证(Validation)

在Test Data的标签未知的情况下,我们需要自己构造测试数据来验证模型的泛化能力,因此把Train Data分割成Train Set和Valid Set两部分,Train Set用于训练,Valid Set用于验证。

简单分割

将Train Data按一定方法分成两份,比如随机取其中70%的数据作为Train Set,剩下30%作为Valid Set,每次都固定地用这两份数据分别训练模型和验证模型。这种做法的缺点很明显,它没有用到整个训练数据,所以验证效果会有偏差。通常只会在训练数据很多,模型训练速度较慢的时候使用。

交叉验证

交叉验证是将整个训练数据随机分成K份,训练K个模型,每次取其中的K-1份作为Train Set,留出1份作为Valid Set,因此也叫做K-fold。至于这个K,你想取多少都可以,但一般选在3~10之间。我们可以用K个模型得分的mean和std,来评判模型得好坏(mean体现模型的能力,std体现模型是否容易过拟合),并且用K-fold的验证结果通常会比较可靠。

如果数据出现Label不均衡情况,可以使用Stratified K-fold,这样得到的Train Set和Test Set的Label比例是大致相同。

1.6 模型集成(Ensemble)

曾经听过一句话,”Feature为主,Ensemble为后”。Feature决定了模型效果的上限,而Ensemble就是让你更接近这个上限。Ensemble讲究“好而不同”,不同是指模型的学习到的侧重面不一样。举个直观的例子,比如数学考试,A的函数题做的比B好,B的几何题做的比A好,那么他们合作完成的分数通常比他们各自单独完成的要高。

常见的Ensemble方法有Bagging、Boosting、Stacking、Blending。

1.6.1 Bagging

Bagging是将多个模型(基学习器)的预测结果简单地加权平均或者投票。Bagging的好处在于可以并行地训练基学习器,其中Random Forest就用到了Bagging的思想。举个通俗的例子,如下图:


分分钟带你杀入Kaggle Top 1%

老师出了两道加法题,A同学和B同学答案的加权要比A和B各自回答的要精确。

Bagging通常是没有一个明确的优化目标的,但是有一种叫Bagging Ensemble Selection的方法,它通过贪婪算法来Bagging多个模型来优化目标值。在这次比赛中,我们也使用了这种方法。

1.6.2 Boosting

Boosting的思想有点像知错能改,每训练一个基学习器,是为了弥补上一个基学习器所犯的错误。其中著名的算法有AdaBoost,Gradient Boost。Gradient Boost Tree就用到了这种思想。

我在1.2.3节(错误分析)中提到Boosting,错误分析->抽取特征->训练模型->错误分析,这个过程就跟Boosting很相似。

1.6.3 Stacking

Stacking是用新的模型(次学习器)去学习怎么组合那些基学习器,它的思想源自于Stacked Generalization这篇论文。如果把Bagging看作是多个基分类器的线性组合,那么Stacking就是多个基分类器的非线性组合。Stacking可以很灵活,它可以将学习器一层一层地堆砌起来,形成一个网状的结构,如下图:

举个更直观的例子,还是那两道加法题:


分分钟带你杀入Kaggle Top 1%

这里A和B可以看作是基学习器,C、D、E都是次学习器。

Stage1: A和B各自写出了答案。 Stage2: C和D偷看了A和B的答案,C认为A和B一样聪明,D认为A比B聪明一点。他们各自结合了A和B的答案后,给出了自己的答案。 Stage3: E偷看了C和D的答案,E认为D比C聪明,随后E也给出自己的答案作为最终答案。

在实现Stacking时,要注意的一点是,避免标签泄漏(Label Leak)。在训练次学习器时,需要上一层学习器对Train Data的测试结果作为特征。如果我们在Train Data上训练,然后在Train Data上预测,就会造成Label Leak。为了避免Label Leak,需要对每个学习器使用K-fold,将K个模型对Valid Set的预测结果拼起来,作为下一层学习器的输入。如下图:


分分钟带你杀入Kaggle Top 1%

由图可知,我们还需要对Test Data做预测。这里有两种选择,可以将K个模型对Test Data的预测结果求平均,也可以用所有的Train Data重新训练一个新模型来预测Test Data。所以在实现过程中,我们最好把每个学习器对Train Data和对Test Data的测试结果都保存下来,方便训练和预测。

对于Stacking还要注意一点,固定K-fold可以尽量避免Valid Set过拟合,也就是全局共用一份K-fold,如果是团队合作,组员之间也是共用一份K-fold。如果想具体了解为什么需要固定K-fold,请看这里。

1.6.4 Blending

Blending与Stacking很类似,它们的区别可以参考这里

1.7 后处理

有些时候在确认没有过拟合的情况下,验证集上做校验时效果挺好,但是将测试结果提交后的分数却不如人意,这时候就有可能是训练集的分布与测试集的分布不一样而导致的。这时候为了提高LeaderBoard的分数,还需要对测试结果进行分布调整。

比如这次比赛,训练数据中正类的占比为0.37,那么预测结果中正类的比例也在0.37左右,然后Kernel上有人通过测试知道了测试数据中正类的占比为0.165,所以我们也对预测结果进行了调整,得到了更好的分数。具体可以看这里。

2 经验篇 2.1 我们的方案(33th)

深度学习具有很好的模型拟合能力,使用深度学习可以较快得获取一个不错的Baseline,对这个问题整体的难度有一个初始的认识。虽然使用深度学习可以免去繁琐的手工特征,但是它也有能力上限,所以提取传统手工特征还是很有必要的。我们尝试Forum上别人提供的方法,也尝试自己思考去抽取特征。总结一下,我们抽取的手工特征可以分为以下4种:

Text Mining Feature,比如句子长度;两个句子的文本相似度,如N-gram的编辑距离,Jaccard距离等;两个句子共同的名词,动词,疑问词等。 Embedding Feature,预训练好的词向量相加求出句子向量,然后求两个句子向量的距离,比如余弦相似度、欧式距离等等。 Vector Space Feature,用TF-IDF矩阵来表示句子,求相似度。 Magic Feature,是Forum上一些选手通过思考数据集构造过程而发现的Feature,这种Feature往往与Label有强相关性,可以大大提高预测效果。

我们的系统整体上使用了Stacking的框架,如下图:


分分钟带你杀入Kaggle Top 1%
Stage1: 将两个问句与Magic Feature输入Deep Learning中,将其输出作为下一层的特征(这里的Deep Learning相当于特征抽取器)。我们一共训练了几十个Deep Learning Model。 Stage2: 将Deep Learning特征与手工抽取的几百个传统特征拼在一起,作为输入。在这一层,我们训练各种模型,有成百上千个。 Stage3: 上一层的输c进行Ensemble Selection。

比赛中发现的一些深度学习的局限:

通过对深度学习产生的结果进行错误分析,并且参考论坛上别人的想法,我们发现深度学习没办法学到的特征大概可以分为两类:

对于一些数据的Pattern,在Train Data中出现的频数不足以让深度学习学到对应的特征,所以我们需要通过手工提取这些特征。 由于Deep Learning对样本做了独立同分布假设(iid),一般只能学习到每个样本的特征,而学习到数据的全局特征,比如TF-IDF这一类需要统计全局词频才能获取的特征,因此也需要手工提取这些特征。

传统的机器学习模型和深度学习模型之间也存在表达形式上的不同。虽然传统模型的表现未必比深度学习好,但它们学到的Pattern可能不同,通过Ensemble来取长补短,也能带来性能上的提升。因此,同时使用传统模型也是很有必要的。

2.2 第一名的解决方案

比赛结束不久,第一名也放出了他们的解决方案,我们来看看他们的做法。他们的特征总结为三个类别:

Embedding Feature Text Mining Feature Structural Feature(他们自己挖掘的Magic Feature)

并且他们也使用了Stacking的框架,并且使用固定的k-fold:

Stage1: 使用了Deep Learning,XGBoost,LightGBM,ExtraTree,Random Forest,KNN等300个模型。 Stage2: 用了手工特征和第一层的预测和深度学习模型的隐藏层,并且训练了150个模型。 Stage3: 使用了分别是带有L1和L2的两种线性模型。 Stage4: 将第三层的结果加权平均。

对比以后发现我们没有做LDA、LSI等特征,并且N-gram的粒度没有那么细(他们用了8-gram),还有他们对Magic Feature的挖掘更加深入。还有一点是他们的Deep Learning模型设计更加合理,他们将筛选出来的手工特征也输入到深度学习模型当中,我觉得这也是他们取得好效果的关键。因为显式地将手工特征输入给深度学习模型,相当于告诉“它你不用再学这些特征了,你去学其他的特征吧”,这样模型就能学到更多的语义信息。所以,我们跟他们的差距还是存在的。

3. 工具篇

工欲善其事,必先利其器。

Kaggle 的上常工具除了大家耳熟能详的XGBoost之外, 这里要着重推荐的是一款由微软推出的LightGBM,这次比赛中我们就用到了。LightGBM的用法与XGBoost相似,两者使用的区别是XGBoost调整的一个重要参数是树的高度,而LightGBM调整的则是叶子的数目。与XGBoost 相比, 在模型训练时速度快, 单模型的效果也略胜一筹。

调参也是一项重要工作,调参的工具主要是Hyperopt,它是一个使用搜索算法来优化目标的通用框架,目前实现了Random Search和Tree of Parzen Estimators (TPE)两个算法。

对于 Stacking,Kaggle 的一位名为Μαριο Μιχαηλιδη的GrandMaster使用Java开发了一款集成了各种机器学习算法的工具包StackNet,据说在使用了它以后你的效果一定会比原来有所提升,值得一试。

以下总结了一些常用的工具:

Numpy | 必用的科学计算基础包,底层由C实现,计算速度快。 Pandas | 提供了高性能、易用的数据结构及数据分析工具。 NLTK | 自然语言工具包,集成了很多自然语言相关的算法和资源。 Stanford CoreNLP | Stanford的自然语言工具包,可以通过NLTK调用。 Gensim | 主题模型工具包,可用于训练词向量,读取预训练好的词向量。 scikit-learn | 机器学习python包 ,包含了大部分的机器学习算法。 XGBoost/LightGBM | Gradient Boosting 算法的两种实现框架。 PyTorch/TensorFlow/Keras | 常用的深度学习框架。 StackNet | 准备好特征之后,可以直接使用的Stacking工具包。 Hyperopt | 通用的优化框架,可用于调参。 4. 总结与建议 在参加某个比赛前,要先衡量自己的机器资源能否足够支撑你完成比赛。比如一个有几万张图像的比赛,而你的显存只有2G,那很明显你是不适合参加这个比赛的。当你选择了一个比赛后,可以先“热热身”,稍微熟悉一下数据,粗略地跑出一些简单的模型,看看自己在榜上的排名,然后再去慢慢迭代。 Kaggle有许多大牛分享Kernel, 有许多Kernel有对于数据精辟的分析,以及一些baseline 模型, 对于初学者来说是很好的入门资料。在打比赛的过程中可以学习别人的分析方法,有利于培养自己数据嗅觉。甚至一些Kernel会给出一些data leak,会对于比赛提高排名有极大的帮助。 其次是Kaggle已经举办了很多比赛, 有些比赛有类似之处, 比如这次的Quora比赛就与之前的Home Depot Product Search Relevance 有相似之处,而之前的比赛前几名已经放出了比赛的idea甚至代码,这些都可以借鉴。 另外,要足够地重视Ensemble,这次我们组的最终方案实现了paper ” Ensemble Selection from Libraries of Models” 的想法,所以有些比赛可能还需要读一些paper,尤其对于深度学习相关的比赛,最新paper,最新模型的作用就举足轻重了。 而且,将比赛代码的流程自动化,是提高比赛效率的一个关键,但是往往初学者并不能很好地实现自己的自动化系统。我的建议是初学者不要急于构建自动化系统,当你基本完成整个比赛流程后,自然而然地就会在脑海中形成一个框架,这时候再去构建你的自动化系统会更加容易。 最后,也是最重要的因素之一就是时间的投入,对于这次比赛, 我们投入了差不多三个多月,涉及到了对于各种能够想到的方案的尝试。尤其最后一个月,基本上每天除了睡觉之外的时间都在做比赛。所以要想在比赛中拿到好名次,时间的投入必不可少。另外对于国外一些介绍kaggle比赛的博客(比如官方博客)也需要了解学习,至少可以少走弯路,本文的结尾列出了一些参考文献,都值得细细研读。 最后的最后,请做好心理准备,这是一场持久战。因为比赛会给你带来压力,也许过了一晚,你的排名就会一落千丈。还有可能造成出现失落感,焦虑感,甚至失眠等症状。但请你相信,它会给你带来意想不到的惊喜,认真去做,你会觉得这些都是值得的。

End.

转载请注明来自36大数据(36dsj.com):36大数据 分分钟带你杀入Kaggle Top 1%


          Datameer Adds Google AI Software to BI Platform Based on Hadoop   

Datameer Adds Google AI Software to BI Platform Based on Hadoop

Rather than being dependent on data scientists to take advantage of deep learning algorithms, Morrell says TensorFlow has been embedded into the …

Link to Full Article

[Link to Full Article]
          TensorFlow to Hadoop By Way of Datameer   

TensorFlow to Hadoop By Way of Datameer

SmartAI, which is still in technical preview, is not helping data scientists to create the models. They will still do that in their favorite coding environment. [Link to Full Article]

          NutanixがGoogle Cloudと連携、複数の切り口でハイブリッドクラウドを実現へ   

Nutanixは2017年6月28日(米国時間)、Nutanix .NEXT Conference 2017で、Google Cloudとのパートナーシップを発表した。NutanixはGCPのデータセンターを借りてクラウドサービスを提供、さらにKubernetes、TensorFlowなどで協業する。


          The Android Things Developer Preview 2 is out, adds support for Intel's Joule, brings TensorFlow for machine learning on IoT platforms, and more   

It's been a big day from the mystical Google land. In addition to all of the Wear stuff, the team behind Android Things has released the second Developer Preview for supported Internet-of-Things platforms. It brings some new features and a few bug fixes, as well as support for the Intel Joule.

Android Things, formerly known as Brillo, is Google's solution to a comprehensive, friendly IoT foundation upon which to build awesome products.

Read More

The Android Things Developer Preview 2 is out, adds support for Intel's Joule, brings TensorFlow for machine learning on IoT platforms, and more was written by the awesome team at Android Police.


          Google、MobileNetsをリリース   

Googleは、携帯電話向けに事前トレーニングしたコンピュータビジョンモデルをTensorflow Githubリポジトリにリリースした。パラメータ数、1画像を処理するための計算、精度が異なる複数のモデルが用意されており、開発者は自分のアプリケーションに合わせて、精度と消費電力をトレードオフすることができる。

By Roland Meertens Translated by sasai
          Machine Learning with Python Course and E-Book Bundle for $49   
4 E-Books & 5 Courses to Help You Perform Machine Learning Analytics & Command High-Paying Jobs
Expires January 22, 2022 23:59 PST
Buy now and get 92% off

Deep Learning with TensorFlow


KEY FEATURES

Deep learning is the intersection of statistics, artificial intelligence, and data to build accurate models, and is one of the most important new frontiers in technology. TensorFlow is one of the newest and most comprehensive libraries for implementing deep learning. Over this course you'll explore some of the possibilities of deep learning, and how to use TensorFlow to process data more effectively than ever.

  • Access 22 lectures & 2 hours of content 24/7
  • Discover the efficiency & simplicity of TensorFlow
  • Process & change how you look at data
  • Sift for hidden layers of abstraction using raw data
  • Train your machine to craft new features to make sense of deeper layers of data
  • Explore logistic regression, convolutional neural networks, recurrent neural networks, high level interfaces, & more

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Dan Van Boxel is a Data Scientist and Machine Learning Engineer with over 10 years of experience. He is most well-known for "Dan Does Data," a YouTube livestream demonstrating the power and pitfalls of neural networks. He has developed and applied novel statistical models of machine learning to topics such as accounting for truck traffic on highways, travel time outlier detection, and other areas. Dan has also published research and presented findings at the Transportation Research Board and other academic journals.

Beginning Python


KEY FEATURES

Python is the general purpose, multi-paradigm programming language that many professionals consider one of the best beginner language due its relative simplicity and applicability to many coding arenas. This course assumes no prior experience and helps you dive into Python fundamentals to come to grips with this popular language and start your coding odyssey off right.

  • Access 43 lectures & 4.5 hours of content 24/7
  • Learn variables, numbers, strings, & more essential components of Python
  • Make decisions on your programs w/ conditional statements
  • See how functions play a major role in providing a high degree of code recycling
  • Create modules in Python
  • Perform image manipulations w/ Python

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

William Fiset is a Mathematics and Computer Science Honors student at Mount Allison University with in interest in competitive programming. William has been a Python developer for +4 years, starting his early Python experience with game development. He owns a popular YouTube channel that teaches Python to beginners and the basics of game development.

Deep Learning with Python


KEY FEATURES

You've seen deep learning everywhere, but you may not have realized it. This discipline is one of the leading solutions for image recognition, speech recognition, object recognition, and language translation - basically the tools you see Google roll out every day. Over this course, you'll use Python to expand your deep learning knowledge to cover backpropagation and its ability to train neural networks.

  • Access 19 lectures & 2 hours of content 24/7
  • Train neural networks in deep learning & to understand automatic differentiation
  • Cover convolutional & recurrent neural networks
  • Build up the theory that covers supervised learning
  • Integrate search & image recognition, & object processing
  • Examine the performance of the sentimental analysis model

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Eder Santana is a PhD candidate in Electrical and Computer Engineering. His thesis topic is on Deep and Recurrent neural networks. After working for 3 years with Kernel Machines (SVMs, Information Theoretic Learning, and so on), Eder moved to the field of deep learning 2.5 years ago, when he started learning Theano, Caffe, and other machine learning frameworks. Now, Eder contributes to Keras: Deep Learning Library for Python. Besides deep learning, he also likes data visualization and teaching machine learning, either on online forums or as a teacher assistant.

Data Mining with Python


KEY FEATURES

Every business wants to gain insights from data to make more informed decisions. Data mining provides a way of finding these insights, and Python is one of the most popular languages with which to perform it. In this course, you will discover the key concepts of data mining and learn how to apply different techniques to gain insight to real-world data. By course's end, you'll have a valuable skill that companies are clamoring to hire for.

  • Access 21 lectures & 2 hours of content 24/7
  • Discover data mining techniques & the Python libraries used for data mining
  • Tackle notorious data mining problems to get a concrete understanding of these techniques
  • Understand the process of cleaning data & the steps involved in filtering out noise
  • Build an intelligent application that makes predictions from data
  • Learn about classification & regression techniques like logistic regression, k-NN classifier, & mroe
  • Predict house prices & the number of TV show viewers

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Saimadhu Polamuri is a data science educator and the founder of Data Aspirant, a Data Science portal for beginners. He has 3 years of experience in data mining and 5 years of experience in Python. He is also interested in big data technologies such as Hadoop, Pig, and Spark. He has a good command of the R programming language and Matlab. He has a rudimentary understanding of Cpp Computer vision library (opencv) and big data technologies.

Data Visualization: Representing Information on the Modern Web E-Book


KEY FEATURES

You see graphs all over the internet, the workplace, and your life - but do you ever stop to consider how all that data has been visualized? There are many tools and programs that data scientists use to visualize massive, disorganized sets of data. This e-book contains content from "Data Visualization: A Successful Design Process" by Andy Kirk, "Social Data Visualization with HTML5 and JavaScript" by Simon Timms," and "Learning d3.js Data Visualization, Second Edition" by Andrew Rininsland and Swizec Teller, all professionally curated to give you an easy-to-follow track to master data visualization in your own work.

  • Harness the power of D3 by building interactive & real-time data-driven web visualizations
  • Find out how to use JavaScript to create compelling visualizations of social data
  • Identify the purpose of your visualization & your project’s parameters to determine overriding design considerations across your project’s execution
  • Apply critical thinking to visualization design & get intimate with your dataset to identify its potential visual characteristics
  • Explore the various features of HTML5 to design creative visualizations
  • Discover what data is available on Stack Overflow, Facebook, Twitter, & Google+
  • Gain a solid understanding of the common D3 development idioms

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals. Working towards that vision, it has published over 3,000 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done–whether that’s specific learning on an emerging technology or optimizing key skills in more established tools.

Python: Master the Art of Design Patterns E-Book


KEY FEATURES

Get a complete introduction to the many uses of Python in this curated e-book drawing content from "Python 3 Object-Oriented Programming, Second Edition" by Dusty Phillips, "Learning Python Design Patterns, Second Edition" by Chetan Giridhar, and "Mastering Python Design Patterns" by Sakis Kasampalis. Once you've got your feet wet, you'll focus in on the most common and useful design patterns from a Python perspective. By course's end, you'll have a complex understanding of designing patterns with Python, allowing you to develop better coding practices and create systems architectures.

  • Discover what design patterns are & how to apply them to writing Python
  • Implement objects in Python by creating classes & defining methods
  • Separate related objects into a taxonomy of classes & describe the properties & behaviors of those objects via the class interface
  • Understand when to use object-oriented features & when not to use them
  • Explore the design principles that form the basis of software design, such as loose coupling, the Hollywood principle, & the Open Close principle, & more
  • Use Structural Design Patterns to find out how objects & classes interact to build larger applications
  • Improve the productivity & code base of your application using Python design patterns
  • Secure an interface using the Proxy pattern

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals. Working towards that vision, it has published over 3,000 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done–whether that’s specific learning on an emerging technology or optimizing key skills in more established tools.

Python: Deeper Insights into Machine Learning E-Book


KEY FEATURES

Machine learning and predictive analytics are becoming one of the key strategies for unlocking growth in a challenging contemporary marketplace. Consequently, professionals who can run machine learning systems are in high demand and are commanding high salaries. This e-book will help you get a grip on advanced Python techniques to design machine learning systems.

  • Learn to write clean & elegant Python code that will optimize the strength of your algorithms
  • Uncover hidden patterns & structures in data w/ clustering
  • Improve accuracy & consistency of results using powerful feature engineering techniques
  • Gain practical & theoretical understanding of cutting-edge deep learning algorithms
  • Solve unique tasks by building models
  • Come to grips w/ the machine learning design process

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals. Working towards that vision, it has published over 3,000 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done–whether that’s specific learning on an emerging technology or optimizing key skills in more established tools.

Python: Real-World Data Science E-Book


KEY FEATURES

Data science is one of the most in-demand fields today, and this e-book will guide you to becoming an efficient data science practitioner in Python. Once you've nailed down Python fundamentals, you'll learn how to perform data analysis with Python in an example-driven way. From there, you'll learn how to scale your knowledge to processing machine learning algorithms.

  • Implement objects in Python by creating classes & defining methods
  • Get acquainted w/ NumPy to use it w/ arrays & array-oriented computing in data analysis
  • Create effective visualizations for presenting your data using Matplotlib
  • Process & analyze data using the time series capabilities of pandas
  • Interact w/ different kind of database systems, such as file, disk format, Mongo, & Redis
  • Apply data mining concepts to real-world problems
  • Compute on big data, including real-time data from the Internet
  • Explore how to use different machine learning models to ask different questions of your data

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals. Working towards that vision, it has published over 3,000 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done–whether that’s specific learning on an emerging technology or optimizing key skills in more established tools.

Mastering Python


KEY FEATURES

Python is one of the most popular programming languages today, enabling developers to write efficient, reusable code. Here, you'll add Python to your repertoire, learning to set up your development environment, master use of its syntax, and much more. You'll soon understand why engineers at startups like Dropbox rely on Python: it makes the process of creating and iterating upon apps a piece of cake.

  • Master Python w/ 3 hours of content
  • Build Python packages to efficiently create reusable code
  • Creating tools & utility programs, and write code to automate software
  • Distribute computation tasks across multiple processors
  • Handle high I/O loads w/ asynchronous I/O for smoother performance
  • Utilize Python's metaprogramming & programmable syntax features
  • Implement unit testing to write better code, faster

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels

Compatibility

  • Internet required

THE EXPERT

Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals. Working towards that vision, it has published over 3,000 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done –whether that’s specific learning on an emerging technology or optimizing key skills in more established tools.

          The Advanced Guide to Deep Learning and Artificial Intelligence Bundle for $42   
This High-Intensity 14.5 Hour Bundle Will Help You Help Computers Address Some of Humanity's Biggest Problems
Expires November 28, 2021 23:59 PST
Buy now and get 91% off

Deep Learning: Convolutional Neural Networks in Python


KEY FEATURES

In this course, intended to expand upon your knowledge of neural networks and deep learning, you'll harness these concepts for computer vision using convolutional neural networks. Going in-depth on the concept of convolution, you'll discover its wide range of applications, from generating image effects to modeling artificial organs.

  • Access 25 lectures & 3 hours of content 24/7
  • Explore the StreetView House Number (SVHN) dataset using convolutional neural networks (CNNs)
  • Build convolutional filters that can be applied to audio or imaging
  • Extend deep neural networks w/ just a few functions
  • Test CNNs written in both Theano & TensorFlow
Note: we strongly recommend taking The Deep Learning & Artificial Intelligence Introductory Bundle before this course.

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels, but you must have some knowledge of calculus, linear algebra, probability, Python, Numpy, and be able to write a feedforward neural network in Theano and TensorFlow.
  • All code for this course is available for download here, in the directory cnn_class

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

Unsupervised Deep Learning in Python


KEY FEATURES

In this course, you'll dig deep into deep learning, discussing principal components analysis and a popular nonlinear dimensionality reduction technique known as t-distributed stochastic neighbor embedding (t-SNE). From there you'll learn about a special type of unsupervised neural network called the autoencoder, understanding how to link many together to get a better performance out of deep neural networks.

  • Access 30 lectures & 3 hours of content 24/7
  • Discuss restricted Boltzmann machines (RBMs) & how to pretrain supervised deep neural networks
  • Learn about Gibbs sampling
  • Use PCA & t-SNE on features learned by autoencoders & RBMs
  • Understand the most modern deep learning developments

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: intermediate, but you must have some knowledge of calculus, linear algebra, probability, Python, Numpy, and be able to write a feedforward neural network in Theano and TensorFlow.
  • All code for this course is available for download here, in the directory unsupervised_class2

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

Deep Learning: Recurrent Neural Networks in Python


KEY FEATURES

A recurrent neural network is a class of artificial neural network where connections form a directed cycle, using their internal memory to process arbitrary sequences of inputs. This makes them capable of tasks like handwriting and speech recognition. In this course, you'll explore this extremely expressive facet of deep learning and get up to speed on this revolutionary new advance.

  • Access 32 lectures & 4 hours of content 24/7
  • Get introduced to the Simple Recurrent Unit, also known as the Elman unit
  • Extend the XOR problem as a parity problem
  • Explore language modeling
  • Learn Word2Vec to create word vectors or word embeddings
  • Look at the long short-term memory unit (LSTM), & gated recurrent unit (GRU)
  • Apply what you learn to practical problems like learning a language model from Wikipedia data

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels, but you must have some knowledge of calculus, linear algebra, probability, Python, Numpy, and be able to write a feedforward neural network in Theano and TensorFlow.
  • All code for this course is available for download here, in the directory rnn_class

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

Natural Language Processing with Deep Learning in Python


KEY FEATURES

In this course you'll explore advanced natural language processing - the field of computer science and AI that concerns interactions between computer and human languages. Over the course you'll learn four new NLP architectures and explore classic NLP problems like parts-of-speech tagging and named entity recognition, and use recurrent neural networks to solve them. By course's end, you'll have a firm grasp on natural language processing and its many applications.

  • Access 40 lectures & 4.5 hours of content 24/7
  • Discover Word2Vec & how it maps words to a vector space
  • Explore GLoVe's use of matrix factorization & how it contributes to recommendation systems
  • Learn about recursive neural networks which will help solve the problem of negation in sentiment analysis

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: advanced, but you must have some knowledge of calculus, linear algebra, probability, Python, Numpy, and be able to write a feedforward neural network in Theano and TensorFlow.
  • All code for this course is available for download here, in the directory nlp_class2

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

          Practical Deep Learning in Theano and TensorFlow for $29   
Build & Understand Neural Networks Using Two of the Most Popular Deep Learning Techniques
Expires November 02, 2021 23:59 PST
Buy now and get 75% off

KEY FEATURES

The applications of Deep Learning are many, and constantly growing, just like the neural networks that it supports. In this course, you'll delve into advanced concepts of Deep Learning, starting with the basics of TensorFlow and Theano, understanding how to build neural networks with these popular tools. Using these tools, you'll learn how to build and understand a neural network, knowing exactly how to visualize what is happening within a model as it learns.

  • Access 23 lectures & 3 hours of programming 24/7
  • Discover batch & stochastic gradient descent, two techniques that allow you to train on a small sample of data at each iteration, greatly speeding up training time
  • Discuss how momentum can carry you through local minima
  • Learn adaptive learning rate techniques like AdaGrad & RMSprop
  • Explore dropout regularization & other modern neural network techniques
  • Understand the variables & expressions of TensorFlow & Theano
  • Set up a GPU-instance on AWS & compare the speed of CPU vs GPU for training a deep neural network
  • Look at the MNIST dataset & compare against known benchmarks
Like what you're learning? Try out the The Advanced Guide to Deep Learning and Artificial Intelligence next.

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels, but you must have some knowledge of calculus, linear algebra, probability, Python, and Numpy
  • All code for this course is available for download here, in the directory ann_class2

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

          The Deep Learning and Artificial Intelligence Introductory Bundle for $39   
Companies Are Relying on Machines & Networks to Learn Faster Than Ever. Time to Catch Up.
Expires October 31, 2021 23:59 PST
Buy now and get 91% off

Deep Learning Prerequisites: Linear Regression in Python


KEY FEATURES

Deep Learning is a set of powerful algorithms that are the force behind self-driving cars, image searching, voice recognition, and many, many more applications we consider decidedly "futuristic." One of the central foundations of deep learning is linear regression; using probability theory to gain deeper insight into the "line of best fit." This is the first step to building machines that, in effect, act like neurons in a neural network as they learn while they're fed more information. In this course, you'll start with the basics of building a linear regression module in Python, and progress into practical machine learning issues that will provide the foundations for an exploration of Deep Learning.

  • Access 20 lectures & 2 hours of content 24/7
  • Use a 1-D linear regression to prove Moore's Law
  • Learn how to create a machine learning model that can learn from multiple inputs
  • Apply multi-dimensional linear regression to predict a patient's systolic blood pressure given their age & weight
  • Discuss generalization, overfitting, train-test splits, & other issues that may arise while performing data analysis
Like what you're learning? Try out the The Advanced Guide to Deep Learning and Artificial Intelligence next.

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels, but you must have some knowledge of calculus, linear algebra, probability, Python, and Numpy
  • All code for this course is available for download here, in the directory linear_regression_class

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

Deep Learning Prerequisites: Logistic Regression in Python


KEY FEATURES

Logistic regression is one of the most fundamental techniques used in machine learning, data science, and statistics, as it may be used to create a classification or labeling algorithm that quite resembles a biological neuron. Logistic regression units, by extension, are the basic bricks in the neural network, the central architecture in deep learning. In this course, you'll come to terms with logistic regression using practical, real-world examples to fully appreciate the vast applications of Deep Learning.

  • Access 31 lectures & 3 hours of content 24/7
  • Code your own logistic regression module in Python
  • Complete a course project that predicts user actions on a website given user data
  • Use Deep Learning for facial expression recognition
  • Understand how to make data-driven decisions
Like what you're learning? Try out the The Advanced Guide to Deep Learning and Artificial Intelligence next.

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels, but you must have some knowledge of calculus, linear algebra, probability, Python, and Numpy
  • All code for this course is available for download here, in the directory logistic_regression_class

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

Data Science: Deep Learning in Python


KEY FEATURES

Artificial neural networks are the architecture that make Apple's Siri recognize your voice, Tesla's self-driving cars know where to turn, Google Translate learn new languages, and so many more technological features you have quite possibly taken for granted. The data science that unites all of them is Deep Learning. In this course, you'll build your very first neural network, going beyond basic models to build networks that automatically learn features.

  • Access 37 lectures & 4 hours of content 24/7
  • Extend the binary classification model to multiple classes uing the softmax function
  • Code the important training method, backpropagation, in Numpy
  • Implement a neural network using Google's TensorFlow library
  • Predict user actions on a website given user data using a neural network
  • Use Deep Learning for facial expression recognition
  • Learn some of the newest development in neural networks
Like what you're learning? Try out the The Advanced Guide to Deep Learning and Artificial Intelligence next.

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: intermediate, but you must have some knowledge of calculus, linear algebra, probability, Python, and Numpy
  • All code for this course is available for download here, in the directory ann_class

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

Data Science: Practical Deep Learning in Theano & TensorFlow


KEY FEATURES

The applications of Deep Learning are many, and constantly growing, just like the neural networks that it supports. In this course, you'll delve into advanced concepts of Deep Learning, starting with the basics of TensorFlow and Theano, understanding how to build neural networks with these popular tools. Using these tools, you'll learn how to build and understand a neural network, knowing exactly how to visualize what is happening within a model as it learns.

  • Access 23 lectures & 3 hours of programming 24/7
  • Discover batch & stochastic gradient descent, two techniques that allow you to train on a small sample of data at each iteration, greatly speeding up training time
  • Discuss how momentum can carry you through local minima
  • Learn adaptive learning rate techniques like AdaGrad & RMSprop
  • Explore dropout regularization & other modern neural network techniques
  • Understand the variables & expressions of TensorFlow & Theano
  • Set up a GPU-instance on AWS & compare the speed of CPU vs GPU for training a deep neural network
  • Look at the MNIST dataset & compare against known benchmarks
Like what you're learning? Try out the The Advanced Guide to Deep Learning and Artificial Intelligence next.

PRODUCT SPECS

Details & Requirements

  • Length of time users can access this course: lifetime
  • Access options: web streaming, mobile streaming
  • Certification of completion not included
  • Redemption deadline: redeem your code within 30 days of purchase
  • Experience level required: all levels, but you must have some knowledge of calculus, linear algebra, probability, Python, and Numpy
  • All code for this course is available for download here, in the directory ann_class2

Compatibility

  • Internet required

THE EXPERT

The Lazy Programmer is a data scientist, big data engineer, and full stack software engineer. For his master's thesis he worked on brain-computer interfaces using machine learning. These assist non-verbal and non-mobile persons to communicate with their family and caregivers.

He has worked in online advertising and digital media as both a data scientist and big data engineer, and built various high-throughput web services around said data. He has created new big data pipelines using Hadoop/Pig/MapReduce, and created machine learning models to predict click-through rate, news feed recommender systems using linear regression, Bayesian Bandits, and collaborative filtering and validated the results using A/B testing.

He has taught undergraduate and graduate students in data science, statistics, machine learning, algorithms, calculus, computer graphics, and physics for students attending universities such as Columbia University, NYU, Humber College, and The New School.

Multiple businesses have benefitted from his web programming expertise. He does all the backend (server), frontend (HTML/JS/CSS), and operations/deployment work. Some of the technologies he has used are: Python, Ruby/Rails, PHP, Bootstrap, jQuery (Javascript), Backbone, and Angular. For storage/databases he has used MySQL, Postgres, Redis, MongoDB, and more.

          Google publie l'API TensorFlow Object Detection pour faciliter l'identification des objets dans les images aux développeurs   
Google publie l'API TensorFlow Object Detection pour faciliter l'identification des objets dans les images
aux développeurs

Google publie une nouvelle API de détection d'objets TensorFlow pour faciliter aux développeurs et chercheurs l'identification des objets dans les images. L'API TensorFlow Object Detection est un framework open source intégré à TensorFlow qui permet de construire, de former et de déployer facilement des modèles de détection d'objets, conçu pour supporter des modèles à la...
          How one Lego reseller built an artificial intelligence to sort bricks   

Jacques Mattheij hoped to make some cash buying cheap boxes of used, unsorted Lego that he'd organize into more valuable assortments for resale. After acquiring two metric tons of bricks, he was motivated to build a technological solution for sorting. He outfitted a conveyor belt with a cheap magnifying USB camera and employed air nozzles to blow the bricks into various bins. The bigger challenge though was how to get the PC to identify the bricks. From IEEE Spectrum:

After a few other failed approaches, and six months in, I decided to try out a neural network. I settled on using TensorFlow, an immense library produced by the Google Brain Team. TensorFlow can run on a CPU, but for a huge speed increase I tapped the parallel computing power of the graphics processing unit in my US $700 GTX1080 Ti Nvidia video card....

...I managed to label a starter set of about 500 assorted scanned pieces. Using those parts to train the net, the next day the machine sorted 2,000 more parts. About half of those were wrongly labeled, which I corrected. The resulting 2,500 parts were the basis for the next round of training. Another 4,000 parts went through the machine, 90 percent of which were labeled correctly! So, I had to correct only some 400 parts. By the end of two weeks I had a training data set of 20,000 correctly labeled images...

Once the software is able to reliably classify across the entire range of parts in my garage, I’ll be pushing through the remainder of those two tons of bricks. And then I can finally start selling off the results!

"How I Built an AI to Sort 2 Tons of Lego Pieces" (IEEE Spectrum)

          NutanixがGoogle Cloudと連携、複数の切り口でハイブリッドクラウドを実現へ   

Nutanixは2017年6月28日(米国時間)、Nutanix .NEXT Conference 2017で、Google Cloudとのパートナーシップを発表した。NutanixはGCPのデータセンターを借りてクラウドサービスを提供、さらにKubernetes、TensorFlowなどで協業する。


          Coupling Adaptive Batch Sizes with Learning Rates. (arXiv:1612.05086v2 [cs.LG] UPDATED)   

Authors: Lukas Balles, Javier Romero, Philipp Hennig

Mini-batch stochastic gradient descent and variants thereof have become standard for large-scale empirical risk minimization like the training of neural networks. These methods are usually used with a constant batch size chosen by simple empirical inspection. The batch size significantly influences the behavior of the stochastic optimization algorithm, though, since it determines the variance of the gradient estimates. This variance also changes over the optimization process; when using a constant batch size, stability and convergence is thus often enforced by means of a (manually tuned) decreasing learning rate schedule.

We propose a practical method for dynamic batch size adaptation. It estimates the variance of the stochastic gradients and adapts the batch size to decrease the variance proportionally to the value of the objective function, removing the need for the aforementioned learning rate decrease. In contrast to recent related work, our algorithm couples the batch size to the learning rate, directly reflecting the known relationship between the two. On popular image classification benchmarks, our batch size adaptation yields faster optimization convergence, while simultaneously simplifying learning rate tuning. A TensorFlow implementation is available.


          谷歌发布新的Tensor Flow对象检测API:特性与更多新内容   
至顶网软件频道消息:TensorFlow为谷歌公司新近发布的技术方案,其立足于对象检测API以帮助开发人员与研究人员更为轻松地发现图片当中所包含的各类对象。目前该项目由谷歌机器智能部门下的谷歌人脑团队负责推进。谷歌公司将利用这项技术实现图像搜索等各类常见任务。谷 ...
          Vincent Granville posted a blog post   
Vincent Granville posted a blog post

          Andrei Macsin added a discussion to the group Analytic, Data Science and Big Data Jobs   
Andrei Macsin added a discussion to the group Analytic, Data Science and Big Data Jobs
Thumbnail

Career Alert, June 23

Job SpotlightSoftware Developer - One Acre FundGenomic Systems Engineer - Kaiser PermanenteData Scientist - Consumer Insights - Fossil GroupSenior Director for Institutional Analytics - Rollins CollegeFeatured JobsKenya Product Innovations Analyst - One Acre FundSenior Data Scientist - Spreemo HealthEngineer, Data Science, Audience Studio - NBCUniversal MediaDeep Learning Content Creator - NVIDIAAnalytics and Insights Specialist - Ramsey Solutions, A Dave Ramsey CompanyDirector, Marketing Analytics & Strategy - The Ad CouncilData Science Manager, Analytics - FacebookResearch Scientist - SpotifyData Scientist – Analytics - Booking .comData Scientist, Risk Analytics - John DeereData Scientist - Reynolds Consumer ProductsProgram Manager, Data Analysis & Reporting - MasterCardDecision Science Analyst II - USAAData Scientist - TapjoyResearch Scientist, Sr - YahooHealthcare Data Scientist - PhilipsSenior Data Scientist - Warner Bros. EntertainmentData Scientist - ShareThisProduction Cytometry Lead, Verily Life Sciences - GoogleData Science Manager, Analytics - TumblrData scientist, Business Strategy - StarbucksCheck out the most recent jobs on AnalyticTalent.comFeatured BlogSix Great Articles About Quantum Computing and HPC This resource is part of a series on specific topics related to data science: regression, clustering, neural networks, deep learning, Hadoop, decision trees, ensembles, correlation, outliers, regression, Python, R, Tensorflow, SVM, data reduction, feature selection, experimental design, time series, cross-validation, model fitting, dataviz, AI and many more. Read full article.Upcoming DSC Webinars and ResourcesA Language for Visual Analytics - DSC Webinar, July 25Self-Service Machine Learning - DSC Webinar, July 18Maximize value of your IoT Data - DSC Webinar, June 29SPSS Statistics to Predict Customer Behavior - DSC Webinar, June 27The Data Incubator Presents: Data Science FoundationsDatabricks & The Data Incubator: Apache Spark Programming for DSArtificial Intelligence Blockchain Bootcamp with Job placement NYCGuarantee yourself a data science career - SpringboardData Science Boot Camp: Pharma and Healthcare - RxDataSciencePython Data Science Training - AccelebrateOnline Executive PGP in Data Science, Business Analytics & Big DataSee More

          Android と TensorFlow: Google I/O 2017 の Codelab を試す   

こんにちは。Google I/O 行きたかった中山です。
今年の I/O もいろいろと興味深い発表がありました。
多くの発表内容を効率的に理解する上で役立つのが、あわせて公開されている Codelabs です。
実際にコードを書きながら、動きを確認することができる、大変よいコンテンツだと思います。
今回は、Android からの取り扱いが劇的に簡単になったという、TensorFlow について、この Codelabs を試しながら、理解を深めてみたいと思います。

1.Codelab:「Android & TensorFlow: Artistic Style Transfer」について

今回試しますのは、Android アプリに TensorFlow を組み込んで、「Artistic style transfer」を試してみよう、というこちらの Codelab

「Artistic style transfer」というのは、ディープラーニングの仕組みを利用して、ある画像に、別の画像の表現スタイルだけを適用して、新しい画像を生成するもの。
具体的には、以下のように、

  1. 左の画像に、
  2. 真ん中の画像のスタイルを適用して、
  3. 右の画像を生成する、

というイメージです。
https://codelabs.developers.google.com/codelabs/tensorflow-style-transfer-android/img/c8b30d69a632f9a2.png

この Codelab で、「Artistic style transfer」の機能を試すことで、同時に、

  • TensorFlow のライブラリを、Android アプリで利用すること
  • 学習済みの TensorFlow のモデルを、Android アプリに組み込んで利用すること
  • 学習済みのモデルを元に「推論」のプロセスを実行すること
  • TensorFlow Graph の、特定の「ノード」に、アプリからアクセスできること

あたりを、合わせて確認できるようになっているようです。
細かく見ていくには、やはり TensorFlow 自体の理解、というのが必須になってはくるのですが、まず今回は、Android アプリから、こんなにシンプルに、TensorFlow の機能を利用できるのだ、というところに焦点をあてて、触っていきたいと思います。

なおこの Codelab を試すにあたって、利用したローカル側環境は以下の通りです。

  • Mac(macOS Sierra)
  • Android Studio(2.3.1)
  • Nexus5X

2.ソースコードの取得

ターミナルから、任意のディレクトリで以下コマンドを実行して、アプリのプロジェクトのソースコードを取得します。

git clone https://github.com/googlecodelabs/tensorflow-style-transfer-android

3.Android Studio で開く

git clone で取得してできた「tensorflow-style-transfer-android」フォルダ内にある「android」フォルダを選択して、Android Studio で開きます。
 
f:id:IntelligentTechnology:20170522171839p:plain:w440

ビルドが完了後、以下のようなファイル構成となっていることが、Android Studio 上で確認できます。
 
 f:id:IntelligentTechnology:20170522175308p:plain:w320

なおこの時点では、まだ TensorFlow 関連の処理は実装されていない、「枠」だけの状態です。
この状態でアプリを起動すると、以下のようになります。

https://codelabs.developers.google.com/codelabs/tensorflow-style-transfer-android/img/725a01c7c2722be7.png

上半分はカメラプレビュー、下半分は、「スタイル」を適用するためのボタンと、適用対象の「スタイル」の候補が並んでいます。

4.重要なメソッド

処理の中心となるのは、プロジェクト内に用意されている「StylizeActivity」クラスのようです。
このクラスの中の、以下のメソッドが、重要な役目をになっている、とのことです。

onPreviewSizeChosen

当アプリで実装している、カメラの機能が利用可能になった際に、このメソッドが呼び出されます。
初期設定のいろいろの処理をここで実行することになります。

setStyle

適用するスタイルを指定するメソッドです。

renderDebug

スタイル適用時のデバッグ情報を出力するメソッドです。

stylizeImage

指定されたスタイルを、画像に適用するメソッドです。

ImageUtils クラスの各種メソッド

プロジェクト内に用意されている ImageUtils クラスでは、画像処理に関するヘルパーメソッドがいくつか実装されています。
これらは、パフォーマンス対策のため、C++ で実装されたものを利用しています。コードの本体は、以下のように「libtensorflow_demo.so」としてあらかじめビルドされた状態で提供されています。
 
 f:id:IntelligentTechnology:20170523101043p:plain:w280

StylizeActivity クラスからも、この ImageUtils クラスのメソッドを利用しています。

5.TensorFlow 学習済みモデルについて

今回利用する学習済み TensorFlow モデル、以下の「stylize_quantized.pb」が本体となっています。
 
 f:id:IntelligentTechnology:20170523102534p:plain:w280

構成としては、こちらのページにも解説があるとおり、以下のように表現される、とのことなのですが、

https://codelabs.developers.google.com/codelabs/tensorflow-style-transfer-android/img/dac7f10dfec75e53.png

とりあえず、今回の Codelab を実行する限りにおいては、これらの詳しい仕様については、すべて把握できていなくても支障ないとのこと。
とはいえ、今後、TensorFlow をより使いこなしていくためには、このあたりの知識も必須になるのでしょう。

6.TensorFlow ライブラリの読み込み

build.gradle」ファイルを開いて、
 
 f:id:IntelligentTechnology:20170523110048p:plain:w320

ファイル末尾の「dependencies」ブロック内に、以下のように、「compile ・・・」を追記し、画面右上に表示される「Sync Now」をクリックします。

android {
  ・・・
  dependencies {
    compile 'org.tensorflow:tensorflow-android:1.2.0-preview'
  }
}

なんと、build.gradle ファイルに 1行書くだけで、TensorFlow ライブラリを利用できるようになりました。
以前は、TensorFlow 自体をビルドしておいて、NDK 入れて、・・・などなど下準備が大変だったようなのですが、時代は変わりました。

7.コードの追加

「StylizeActivity」クラスに、以下の private フィールドを追加します。

// TensorFlow ライブラリが提供する、
// TensorFlow の機能を呼び出すためのインタフェースとなるクラス
private TensorFlowInferenceInterface inferenceInterface;
// 学習済みモデルのファイル
private static final String MODEL_FILE = 
  "file:///android_asset/stylize_quantized.pb";
// TensorFlow の「ノード」の識別名
private static final String INPUT_NODE = "input";
private static final String STYLE_NODE = "style_num";
private static final String OUTPUT_NODE = 
  "transformer/expand/conv3/conv/Sigmoid";

また「onPreviewSizeChosen」メソッド内に、以下のように「inferenceInterface」フィールドを初期化するコードを追加します。

@Override
public void onPreviewSizeChosen(final Size size, final int rotation) {
  ・・・
  // inferenceInterface フィールドの初期化
  inferenceInterface = 
    new TensorFlowInferenceInterface(getAssets(), MODEL_FILE);
}

次に、「stylizeImage」メソッドの、

// TODO: Process the image in TensorFlow here.

と書かれている部分の下側に、以下のように、inferenceInterface のメソッドを呼び出すコードを追加します。

private void stylizeImage(final Bitmap bitmap) {
  ・・・
  // TODO: Process the image in TensorFlow here.
 
  // 元画像データを TensorFlow 側にコピー
  inferenceInterface.feed(INPUT_NODE, floatValues,
            1, bitmap.getWidth(), bitmap.getHeight(), 3);
  // 適用するスタイルの画像データを、TensorFlow 側にコピー
  inferenceInterface.feed(STYLE_NODE, styleVals, NUM_STYLES);
 
  // TensorFlow 側で、元画像データにスタイルを適用する処理を実行
  inferenceInterface.run(new String[] {OUTPUT_NODE}, isDebug());

  // 適用結果を取得して配列に保存
  inferenceInterface.fetch(OUTPUT_NODE, floatValues);
 
  ・・・

最後に、デバッグ用の出力を行う「renderDebug」メソッドにも一部コードを追加します。
こちらは必ずしも必要、というわけではないと思うのですが、ついでとして。
すでに実装されている、

final Vector<String> lines = new Vector<>();

というコードのすぐ下に、以下のようにコードを追加します。

private void renderDebug(final Canvas canvas) {
・・・
  final Vector<String> lines = new Vector<>();

  // TensorFlow の処理に関するデバッグ情報を出力
  final String[] statLines = inferenceInterface.getStatString().split("\n");
  Collections.addAll(lines, statLines);
  lines.add("");

  ・・・

これでコードの追加は完了です。
なお、このアプリ、サンプルのアプリの割には、けっこういろいろなことをやっているようで、「StylizeActivity」クラスにもともと実装されているコードは、意外とボリュームがあります。
TensorFlow の機能を呼び出す部分は、数行のコード追加で行えるようですが、それをアプリとしてきれいに実装するには、やはり相応の量のコードを記述する必要があるようです。

8.アプリを実行する

作成したアプリを Android 実機で実行します。
画面上側のカメラプレビューに映るイメージが、画面下側で選択したスタイルが適用された形で、リアルタイムに描画されます。

今回、その効果を検証しましたのは、私が毎週のようにお世話になっている、たも屋林店 の「ひやかけ1.5玉とちくわの天ぷら(わかめトッピング無料) 380円」。
ここ最近は気温も高くなり、ひやかけのおいしい季節になってまいりました。
 
 f:id:IntelligentTechnology:20170523133727j:plain:w400

これを、今回作成したアプリを通して見ると、以下のように表示されました。
 
 f:id:IntelligentTechnology:20170523133755p:plain:w400

まったくおいしくなさそうな絵になっていますが、スタイルの適用、という面では想定通りの結果となっているようです。

9.まとめ

TensorFlow に関しては、どちらかというと「学習させる」ほうがメインであるようにも思えますが、しかし、これまでは、学習済みのモデルをアプリから利用するだけでも、一手間かかっていた、という状況でした。
今回の Codelab のアプリ作成で、TensorFlow をマスターできる、というわけではまったくありませんけれども、それでも、build.gradle に 1行追加するだけで、容易に TensorFlow の機能を呼び出せる、というのを体験できる、という意味では、試しがいがあるではないか、と感じました。


          Google Cloud Vision API ハンズオン 参加してきました。   

中山です。

3/20(日)、香川県高松市の「e-とぴあ・かがわ」で開催されました、「Google Cloud Vision API ハンズオン」イベントに参加してまいりました。

gdgshikoku.connpass.com

しかしこのときはまだ、Googleさんがそんな情報まで把握している、というのは夢にも思わなかったのです・・・。


このハンズオンは、「e-とぴあ文化祭2016」の中のひとつのイベントとして開催されていました。

f:id:IntelligentTechnology:20160322165858j:plain:w400

Google Cloud Vision API とは

Google Cloud Vision API は、Google社が提供する、画像解析のためのAPIです。
以下、ハンズオンのサイトから引用します。

指定されている画像に何が写っているのか、人の場合はその表情が笑っているのか怒っているのか、さらに有名なランドマークが写っていればそれがどこの何かを教えてくれます。
またOCRのように文字を読み取ることも可能です。

Google Cloud Vision API自体は有料ですが、今回のハンズオンでは、無料トライアルの範囲で、機能を試すことができました。
無料トライアルでは、60日間、300ドルの範囲で、機能を試すことができます。また、1ヶ月に1000リクエスト程度まででしたら、料金が発生することなく利用できるようです。

Google Cloud Vision API を試す

ハンズオン自体は、Google Cloud Vision APIの「Getting Started」ページの内容にしたがって進められました。
APIキーなど、各種の設定を行っておく必要がありますが、これらについては、公式サイトの説明にゆずることといたします。

Google Cloud Vision の API としては、実は1種類しかありません。
Macを使う場合、いちばんシンプルに試そうとすると、以下のような手順になります。

1.まずは解析対象の画像ファイルを用意して、

http://people.ucsc.edu/~kamacdon/bulldogpuppy1.jpg
http://people.ucsc.edu/~kamacdon/

2.それをbase64変換して、

f:id:IntelligentTechnology:20160322171525p:plain

3.そのbase64変換した文字列を、以下のようなJSONのデータに埋め込んで、

f:id:IntelligentTechnology:20160322171708p:plain

4.そのJSONデータファイルを、Google Cloud Vision API のサーバに送信すると、

f:id:IntelligentTechnology:20160322172342p:plain

5.サーバから以下のような解析結果が返されます。

f:id:IntelligentTechnology:20160322172637p:plain

今回の場合は、0.99以上のスコアで「dog」である、と判定されたようです。

いろいろ試す

上記のJSONデータファイルに指定する、画像解析の「type」としては、ほかにも以下のようなものが指定できるそうです。

  • FACE_DETECTION: 顔認識
  • LANDMARK_DETECTION: 建物などの画像から、その位置情報を特定
  • LOGO_DETECTION: 企業ロゴ、ブランドロゴの検出
  • LABEL_DETECTION: カテゴリ検出、画像種類判定(上記で使っていたもの)
  • TEXT_DETECTION: 文字認識 OCR機能
  • SAFE_SEARCH_DETECTION: 不適切画像の検出
  • IMAGE_PROPERTIES: 画像の属性情報抽出(画像の主要な色の検出など)

以下いろいろと試してみました。

画像種類判定

四国新聞でも連載中の大人気4コマ漫画、かまタマくんの画像は、

http://pbs.twimg.com/media/CTsOGKvUkAAGD66.jpg
http://sp.shikoku-np.co.jp/comic/archive.htm

f:id:IntelligentTechnology:20160322173424p:plain

解析結果の件数を5件に増やしてみたものの「book」とか「area」とか、なにやらあいまいな結果が。
f:id:IntelligentTechnology:20160322173506p:plain

OCR機能

しかし、おなじかまタマくんの画像でOCR機能を呼び出してみると、
http://pbs.twimg.com/media/CTsOGKvUkAAGD66.jpg
http://sp.shikoku-np.co.jp/comic/archive.htm

f:id:IntelligentTechnology:20160322173748p:plain

かなり正確に文字を拾ってる!

f:id:IntelligentTechnology:20160322173812p:plain

位置情報特定

香川県にある「がもううどん」の写真で「LANDMARK_DETECTION」の機能を呼び出してみると、

http://www.sanuki-udon.net/images/udon/R0063793.jpg
http://www.sanuki-udon.net/2009/12/post_237.html

f:id:IntelligentTechnology:20160322174300p:plain

以下のように、緯度経度の情報が返ってきました。(descriptionは「Udon」。)

f:id:IntelligentTechnology:20160322174403p:plain

ひょっとして、と思い、その緯度経度を Google Mapsで検索すると・・・、

f:id:IntelligentTechnology:20160322174512p:plain

ほんとに「がもううどん」のお店の場所が表示されました。Googleさん、ちょっと怖い!

顔認識

宇宙飛行士の集合写真で顔認識を試したところ、

http://blog-imgs-52.fc2.com/1/0/r/10rank/nasa_convert_20121023004955.jpeg
http://10rank.blog.fc2.com/blog-entry-90.html

f:id:IntelligentTechnology:20160322174954p:plain

認識した顔一つ一つにたいして、その座標などの情報が返されました。

f:id:IntelligentTechnology:20160322175038p:plain

不適切画像の検出

海外ドラマ「ウォーキングデッド」に登場するゾンビの画像が「不適切画像」にあたるかどうかを試したところ、

f:id:IntelligentTechnology:20160322175246p:plain

「VERY_UNLIKELY」とか「UNLIKELY」ばかりでしたので、そんなに「有害」ではない?「violence」が「UNLIKELY」なので、少しスコアが高いか?(画像自体は、恐ろしい写真なので、ここへの掲載は見送りますけど。)

f:id:IntelligentTechnology:20160322175335p:plain

まとめ

けっこう簡単に、画像認識の機能を試すことができました。
Google Cloud Vision API 自体は人工知能ライブラリである「TensorFlow」の機能を利用している、とのことです。

建物の画像から位置情報がわかってしまうのは、ちょっと怖い気もしましたが、これも昨今の人工知能の発達の成果のひとつなのでしょう。
シンプルなAPIなので、応用の幅も広いのではないか、と感じました。


          (USA-CA-Mountain View) Big Data Engineer - Distributed Systems, Product   
Big Data Engineer - Distributed Systems, Product Big Data Engineer - Distributed Systems, Product - Skills Required - Big Data, Distributed Systems, HPC, Machine Learning/Deep Learning Algorithms, Java/C/C++/SQL/Scala, HDFS/Spark/Cassandra/TensorFlow If you are a Big Data Engineer with experience, please read on! With an office in Mountain View, we are the creators of a hyper-acceleration technology for popular big data processing engines using both hardware and software accelerators! Currently, we're looking for a Big Data Engineer with distributed systems experience to join our tight-knit team in Mountain View! The ideal candidate will have experience working at one or more of the following companies: IBM, Spark Technology Center, MapR, Hortonworks, and/or Cloudera. **Top Reasons to Work with Us** - Competitive compensation package (salary + equity) - Potential work sponsorship (if needed) - Work with cutting edge tech! **What You Will Be Doing** - Develop and maintain the high performance libraries in our technology stack - Work with our product engineering team on our hyper-acceleration (CPUs + GPUs + FPGAs) platform for Spark, Machine Learning and AI workloads - Architect, design, develop and release the advanced infrastructure of our core big data processing engines - Building, fine-tuning and optimizing the performance of our technology stack **What You Need for this Position** - Experience with big data engineering - Experience distributed systems - Experience with HPC programming (Plus) - Experience working at one or more of the following companies: IBM, Spark Technology Center, MapR, Hortonworks, and/or Cloudera - Experience with Java, C/C++, SQL, and/or Scala - Familiarity with C++11 is a plus - Familiarity with machine learning/deep learning algorithms - Experience with big data frameworks, such as HDFS, Spark, Cassandra, or TensorFlow - Experience with query optimization and product performance improvement - Experience with MySQL preferred - Experience with Linux kernel preferred - BS, MS, or PhD in Computer Science and/or Computer Engineering **What's In It for You** - Up To $170K salary + equity (DOE) - Equity - Health benefits So, if you are a Big Data Engineer with experience, please apply today! Applicants must be authorized to work in the U.S. **CyberCoders, Inc is proud to be an Equal Opportunity Employer** All qualified applicants will receive consideration for employment without regard to race, color, religion, sex, national origin, disability, protected veteran status, or any other characteristic protected by law. **Your Right to Work** – In compliance with federal law, all persons hired will be required to verify identity and eligibility to work in the United States and to complete the required employment eligibility verification document form upon hire. *Big Data Engineer - Distributed Systems, Product* *CA-Mountain View* *EO1-1382518*
          2017MWC上海站前瞻 亚信数据CTO於今详解机器学习平台Aura   

2017世界移动大会上海将于6月28日-7月1日举办。一向在市场活动方面颇为低调的亚信将在本次展会上高调登场,并将展出在人工智能、物联网、大数据、亚信安全领域的最新研发成果和客户案例。

活动前夕,亚信数据CTO於今接受媒体采访,分享了亚信数据在人工智能方面的布局、产品进展以及热点话题的看法。

作为业内顶尖的大数据和人工智能领域技术专家,在加盟亚信之前,於今博士曾担任蚂蜂窝副总裁兼首席架构师、OpenX(全球第二大广告交易平台,仅次于Google,支撑日均500亿笔RTB交易规模)技术副总裁兼首席架构师、TriTech Tiburon执行技术总监等职位。在TriTech Tiburon期间,他所带领的团队负责开发公司的第二代产品线,包括核心警务系统及处理美国近30年的公安大数据,并整合社交大数据以预测未来犯罪。

於今重点分享了机器学习平台Aura及应用案例。他首先阐释了亚信推出Aura的原因——降低人工智能的技术门槛。一直以来,从事机器学习研究和应用往往需要计算机科学相关专业或有统计学丰富经验的中高端人才,而传统企业人才的技术背景难以匹配。 研发推出Aura平台就是为了让更多企业利用大数据和人工智能技术,享受技术所带来的业务价值提升。

依托亚信的传统优势,Aura定义为运营商级别(Carrier-grade)的平台,有如下几个方面的特点:(1)覆盖面广 —— 服务国内大部分人口;(2)高稳定性 —— 达到了电信级别的SLA;(3)高效率,模型相应速度非常快,满足实时性需求。


2017MWC上海站前瞻 亚信数据CTO於今详解机器学习平台Aura
从技术架构层面来看,Aura平台可以分为三大子平台:大数据平台、机器学习平台、数据驱动型应用平台。其中机器学习平台是核心,它整合了业界主流的开源算法框架(例如TensorFlow、Caffe、Spark MLlib等),承担模型训练和优化的任务。在机器学习平台之上的数据驱动型应用层则实现行业数据模型的高效重用。

据於今介绍,Aura里其中一个重要特色是“统一数据模型”(Common Data Model, CDM)。依靠CDM,机器学习模型可以快速在企业间移植,实现企业应用机器学习技术效率的大幅提升。 Aura的机器学习平台提供两个开发工具。 其中,Aura Visual Pipeline 提供向导式和情景化的快速模型定制。经过探索和实践抽象出一系列典型的机器学习应用场景。针对每个场景,都将科学的分析建模过程形成一个向导式的流程。使用者只需要提供一些必要的信息,就可自动生成一个有效的应用模型,也使整个流程变得水到渠成。另一个工具Aura Advanced Notebook,支持多种编程语言,并基于浏览器界面操作。有助于快速调试模型。结合数据、算法,Advanced Notebook适于工程师精细的模型调整。

数据和模型之间建立反馈闭环

在於今看来,在Aura平台架构设计上,最重要的是数据和模型之间建立了反馈闭环。机器学习技术日趋成熟,以往项目化的应用机器学习技术,往往只关注模型交付时的效率表现。而随着时间的变化,模型的效果没有新数据的增量训练,往往会逐渐降低。这是因为数据和模型之间由于缺乏系统性和平台级的支持,没有形成反馈闭环。所以Aura机器学习平台着力于这个痛点。Aura平台上部署的模型采用自动化模型的再训练机,保证模型持续的有效性。

随后,於今还介绍了亚信Aura平台在行业方面的案例。他在电信运营商方面重点介绍了三个场景:将用户历史信息和深度画像结合,再与产品和服务的具体信息做精准匹配,预测客户潜在需求并展开营销动作;根据地理位置信息多维度预测用户需求;通过收集运营商或电力等大型企业设备数据信息预测维修周期,设计维修方案,节约巡检成本。

金融行业场景,於今谈到了有两个主要场景,一个是实时反欺诈,一个是智能投顾。

最后,於今还详细介绍了亚信人工智能平台在医疗医保控费和反欺诈方面的应用案例。以咸阳为例,亚信和咸阳市政府合作,把咸阳的全量医疗数据集中在阳关医疗云中。咸阳有30多家实体医院,基 于三大类数据,比如影像数据、医疗设备IOT数据、EMR 数据,建立训练模型,可以更精准的判断医疗欺诈行为。

2017世界移动大会上海即将开幕,期待在展区看到亚信更多的研发成果和客户案例。


          JETSON TX2: Tensorflow-1.1.0のインストール   
JETSON TX2にtensorflow1.1.0をインストールしたときのメモ。JetsonHacksの”TensorFlow on NVIDIA Jetson TX2 Development Kit […]
          【Python】Tensorflowでresizeした画像をmatplotlibで表示したい   
>>> import matplotlib
>>> import matplotlib.pyplot as plt
>>> import tensorflow as tf
>>> tf.__version__
'1.1.0'
>>> matplotlib.__version__
'2.0.0'

Tensorflowの画像前処理関数って結構豊富っぽくて使いたいって練習しようとしてた。

tf.image.resize_images  |  TensorFlow

単純にresizeしたいと思って↑の関数を使う。

# image -> opencvとかで読み込んだ画像
>>> tf_image = tf.image.resize_images(image, [100, 100])
>>> session = tf.Session()
>>> with session.as_default():
...     output = tf_image.eval()
...
>>> plt.imshow(output)
>>> plt.show()

そしたら、反転?みたいな画像がでてきて困惑。

なーぜー?

stackoverflow.com

matplotlibでtensorを表示するためには、tf.float32でcastしたあとに255.0で割ってあげればおk

>>> image = tf.cast(image, tf.float32) / 255.0
>>> tf_image = tf.image.resize_images(tf_image, [100, 100])
>>> session = tf.Session()
>>> with session.as_default():
...     output = tf_image.eval()
...
>>> plt.imshow(output)
>>> plt.show()

これで閲覧できた。

そもそもmatplotlibじゃなくて、tensorboardでみればいいのでは?

・・・・。(試してないからわからんけど)