Base Table class from which other table classes inherit. By default, a table is constrained to a default width but this can be adjusted via the max_width option or Hirb::View.width. Rows can be an array of arrays or an array of hashes.
An array of arrays ie [[1,2], [2,3]], would render:
+---+---+ | 0 | 1 | +---+---+ | 1 | 2 | | 2 | 3 | +---+---+
By default, the fields/columns are the numerical indices of the array.
An array of hashes ie [{:age=>10, :weight=>100}, {:age=>80, :weight=>500}], would render:
+-----+--------+ | age | weight | +-----+--------+ | 10 | 100 | | 80 | 500 | +-----+--------+
By default, the fields/columns are the keys of the first hash.
Callback methods can be defined to add your own options that modify rows right before they are rendered. Here’s an example that allows for searching with a :query option:
module Query # Searches fields given a query hash def query_callback(rows, options) return rows unless options[:query] options[:query].map {|field,query| rows.select {|e| e[field].to_s =~ /#{query}/ } }.flatten.uniq end end Hirb::Helpers::Table.send :include, Query >> puts Hirb::Helpers::Table.render [{:name=>'batman'}, {:name=>'robin'}], :query=>{:name=>'rob'} +-------+ | name | +-------+ | robin | +-------+ 1 row in set
Callback methods:
must be defined in Helpers::Table and end in ‘_callback’.
should expect rows and a hash of render options. Rows will be an array of hashes.
are expected to return an array of hashes.
are invoked in alphabetical order.
For a thorough example, see Boson::Pipe.
Boolean which sets the default for :::filter_any option.
A hash which maps a cell value’s class to a filter. This serves to set a default filter per field if all of its values are a class in this hash. By default, Array values are comma joined and Hashes are inspected. See the :::filter_any option to apply this filter per value.
Holds last table object created
Main method which returns a formatted table.
An array which overrides the default fields and can be used to indicate field order.
A hash of fields and their header names. Fields that aren’t specified here default to their name. When set to false, headers are hidden. Can also be an array but only for array rows.
A hash of fields and their maximum allowed lengths. Maximum length can also be a percentage of the total width (decimal less than one). When a field exceeds it’s maximum then it’s truncated and has a … appended to it. Fields that aren’t specified have no maximum.
The maximum allowed width of all fields put together including field borders. Only valid when :resize is true. Default is Hirb::View.width.
Resizes table to display all columns in allowed :max_width. Default is true. Setting this false will display the full length of each field.
When set to true, numbers rows by adding a :hirb_number column as the first column. Default is false.
A hash to change old field names to new field names. This can also be an array of new names but only for array rows. This is useful when wanting to change auto-generated keys to more user-friendly names i.e. for array rows.
A regexp that selects which fields to display. By default this is not set and applied.
A hash of fields and their filters, applied to every row in a field. A filter can be a proc, an instance method applied to the field value or a Filters method. Also see the ::filter_classes attribute below.
A filter, like one in :filters, that is applied to all headers after the :headers option.
When set to true, any cell defaults to being filtered by its class in :filter_classes. Default ::filter_any.
Hash which maps classes to filters. Default is ::filter_classes.
When set to true, renders fields in all rows. Valid only in rows that are hashes. Default is false.
When set to true, renders row count description at bottom. Default is true.
When set to true, escapes special characters n,t,r so they don’t disrupt tables. Default is false for vertical tables and true for anything else.
When set to true, renders a vertical table using Hirb::Helpers::VerticalTable. Default is false.
When set to true, renders a unicode table using Hirb::Helpers::UnicodeTable. Default is false.
When set to true, renders a tab-delimited table using Hirb::Helpers::TabTable. Default is false.
Choose style of table: :simple, :vertical, :unicode, :tab or :markdown. :simple just uses the default render. Other values map to a capitalized namespace in format Hirb::Helpers::OptionValTable.
Examples:
Hirb::Helpers::Table.render [[1,2], [2,3]] Hirb::Helpers::Table.render [[1,2], [2,3]], :max_fields=>{0=>10}, :header_filter=>:capitalize Hirb::Helpers::Table.render [['a',1], ['b',2]], :change_fields=>%w{letters numbers}, :max_fields=>{'numbers'=>0.4} Hirb::Helpers::Table.render [{:age=>10, :weight=>100}, {:age=>80, :weight=>500}] Hirb::Helpers::Table.render [{:age=>10, :weight=>100}, {:age=>80, :weight=>500}], :headers=>{:weight=>"Weight(lbs)"} Hirb::Helpers::Table.render [{:age=>10, :weight=>100}, {:age=>80, :weight=>500}], :filters=>{:age=>[:to_f]} Hirb::Helpers::Table.render [{:age=>10, :weight=>100}, {:age=>80, :weight=>500}], :style=> :simple}
# File lib/hirb/helpers/table.rb, line 117 def render(rows, options={}) choose_style(rows, options) rescue TooManyFieldsForWidthError $stderr.puts "", "** Hirb Warning: Too many fields for the current width. Configure your width " + "and/or fields to avoid this error. Defaulting to a vertical table. **" Helpers::VerticalTable.render(rows, options) end
# File lib/hirb/helpers/table.rb, line 159 def chars self.class.const_get(:CHARS) end


Our Goal
Inspire youth, parents, and mentors to join together and use technology to change South Central LA for the better. We believe computer science is a tool for social change. Your app could help improve your church, school, block, park, or any part of your community. If you are between the ages of 9 and 17, come and build a cool website or app with us!


Submits a number of requests for slightly-different data sequentially and reports how many responses came back before timeout (or until all responses were received).


1">{{markers.length}} Markers Found.
{{markers.length}} Marker Found.
No Markers found.
No results found.
edit {{details._description}}


| 020:061 Khan | : |
Musa (Moses) said to them: "Woe unto you!   |
| 020:061 Maulana | : |
Moses said to them: Woe to you!   He who lieth faileth miserably. |
| 020:061 Rashad | : |
Moses said to them, "Woe to you. Do you fabricate lies to fight GOD and thus incur His retribution? Such fabricators will surely fail." |
| 020:061 Sarwar | : |
Moses told them, (the magicians) "Woe to you if you invent falsehood against God; you will be destroyed by the torment. Whoever invents falsehood against God will certainly be lost."   |
Concepts/Themes Covered: الإنسان والعلاقات الأخلاقية > الأخلاق الذميمة > الافتراء على الله ورسوله Man and The Moral Relations>The Dispraised Morals>Fabrication Against Allah and His Messenger
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


Hi Everyone!
My name is Shane Lian. (My Chinese first name is Wangtao but I usually use my English name) I'm an international student from China studying in the Univerisity of Wisconsin-Madison. I'm currently majoring Computer Sciences.
Besides programming, I love music. I also record my own music when I'm free.
Hangzhou is my hometown. As one of the most famous cities in China, Hangzhou is well-known for its beautiful scenery. It is definitly worth visiting. Contact me for a guide!
Joined with Enactus Hangzhou Dianzi University team and Hangzhou HC Software Inc. Functionality and Integretion Testing Braille Screen Reader for the Blind. Assisted 3 blind trainees to learn basic computer operations such as typing, settings in OS and online shopping etc.
Providing day-to-day testing shared services support to the NM.com - Personal Insurance & Investments web application focusing on Performance Testing with HP Loadrunner and Automation Testing with Nightwatch.js


---
layout: default
highlight_nav: home
---
{% pattern banners/main-banner button_url="/womens-swim/" heading="Explore the Surf
Essentials Collection" text="The must-haves of the season." image="info-banner.jpg" %}
Who We Are
{% pattern navigation/introduction intro-text="Surf 1685’s vision is to be known as the top of the market for all surf gear. The website allows surfers of every experience level to purchase items such as wetsuits, swimwear, and cover-ups, while ensuring quality and top-of-the-line trends." %}
Shop by Category
{% for product in site.products %}
{% pattern cards/product-card-category data=product %}
{% endfor %}
{% pattern banners/info-banner button_url="/womens-swim/" heading="Beach days aren't far away" text="New arrivals online now & in-stores 1.17" image="info-banner.jpg" %}
#Surf1685
{% pattern cards/image-card image="guy-surfing.jpg" %}
{% pattern cards/image-card image="palm-tree-rows.jpg" %}
{% pattern cards/image-card image="walking-into-surf.jpg" %}
{% pattern navigation/introduction text="Show us your #Surf1685. Mention or tag @Surf1685 and you could be featured here!" %}


--- layout: page title: About header-img: "img/about-bg.png" ---
A liberal arts grad with a degree in Politics and Spanish that's learning how to code!


We're using Ropsten network currently, it works, but transaction confirmation times are unpredictable. Test time increased by several minutes after I added ETH/JST trade test to Azure pipeline. Our own network with instant block generation will dramatically speed up the process.
The issue was solved after new router installation. Highly likely it was just faulty hardware. Also this fix could affect: https://github.com/artemii235/SuperNET/pull/294, but we need to test with old router to be sure. We will do it later maybe.


How to unflag all of the emails on your iPhone's Mail app, and empty your 'Starred' folder, Business Insider - Business Insider Singapore
by Jennifer Still, Business Insider US- It’s easy to unflag all of your emails on an iPhone at once, taking them all out of the Starred folder and emptying it.
- You may want to flag emails in the Mail app so you can return to them quickly in future and organize your inbox.
- Visit Business Insider’s homepage for more stories.
Flagging emails on an iPhone is one of the easiest ways to keep track of messages that require a follow-up, or that you don’t want to lose track of in an overcrowded inbox.
With just a tap, you can immediately see all those messages in one place and work your way through them, sending responses where needed or completing any requests they might contain.
However, sometimes it’s easy to forget to unflag emails when you’re done with them, leaving you with a bunch of messages you no longer need flagged. When that happens, you can unflag all of them at once in a few simple steps.
Here’s how to do it.
Check out the products mentioned in this article:
iPhone 11 (From $699.99 at Best Buy)
How to unflag all of your emails on an iPhone
1. On your iPhone, tap the Mail app icon to open it.
2. Tap the “Starred” folder to be taken to your flagged messages.
3. In the upper right-hand corner of your screen, tap “Edit.”
4. Tap “Select All” to select all flagged messages.
5. Tap “Mark” in the lower left-hand corner of your screen.
6. Tap “Unflag.” All messages will then be unflagged and will appear according to date in your inbox.
Note that you will need to re-flag any emails you still want quick access to in the future.
It’s easy to do this in your inbox, where you can select the messages you want to flag, tap “Mark,” and then “Flag.” Those emails will then appear in your Starred folder.
Related coverage from How To Do Everything: Tech:
-
How to mark all emails as read on your iPhone in 4 steps
-
How to easily delete all of your emails on an iPhone
-
I just cleared out my Gmail using a simple trick that took only a few minutes – here’s how to do it
-
How to add any email account to your iPhone
-
How to clear the Safari search history on your iPhone in three different ways


Custom scrollbars for IE, Chrome and Firefox using CSS March 4, 2013 by Jeff 40 Comments Using Custom scrollbars in your website can be really eye-catching and they go well with the website’s design. For web designers, it’s difficult creating them with JavaScript. Instead, you can create custom scrollbars using CSS. According to my acknowledge, it only worked in Internet Explorer. During my recent project, my client required the scrollbar to be stylized with CSS, and make it work in most mainstream browsers. So after a bit of googling, I found the tricks to do so and share them with you here.
Custom scrollbars for IE, Chrome and Firefox using CSS March 4, 2013 by Jeff 40 Comments Using Custom scrollbars in your website can be really eye-catching and they go well with the website’s design. For web designers, it’s difficult creating them with JavaScript. Instead, you can create custom scrollbars using CSS. According to my acknowledge, it only worked in Internet Explorer. During my recent project, my client required the scrollbar to be stylized with CSS, and make it work in most mainstream browsers. So after a bit of googling, I found the tricks to do so and share them with you here.
Custom scrollbars for IE, Chrome and Firefox using CSS March 4, 2013 by Jeff 40 Comments Using Custom scrollbars in your website can be really eye-catching and they go well with the website’s design. For web designers, it’s difficult creating them with JavaScript. Instead, you can create custom scrollbars using CSS. According to my acknowledge, it only worked in Internet Explorer. During my recent project, my client required the scrollbar to be stylized with CSS, and make it work in most mainstream browsers. So after a bit of googling, I found the tricks to do so and share them with you here.


Interface SpeechContextOrBuilder (2.0.0)
public interface SpeechContextOrBuilder extends MessageOrBuilder
Implements
MessageOrBuilderMethods
getPhrases(int index)
public abstract String getPhrases(int index)
A list of strings containing words and phrases "hints" so that the speech recognition is more likely to recognize them. This can be used to improve the accuracy for specific words and phrases, for example, if specific commands are typically spoken by the user. This can also be used to add additional words to the vocabulary of the recognizer. See usage limits. List items can also be set to classes for groups of words that represent common concepts that occur in natural language. For example, rather than providing phrase hints for every month of the year, using the $MONTH class improves the likelihood of correctly transcribing audio that includes months.
repeated string phrases = 1;
| Name | Description |
| index | int The index of the element to return. |
| Type | Description |
| String | The phrases at the given index. |
getPhrasesBytes(int index)
public abstract ByteString getPhrasesBytes(int index)
A list of strings containing words and phrases "hints" so that the speech recognition is more likely to recognize them. This can be used to improve the accuracy for specific words and phrases, for example, if specific commands are typically spoken by the user. This can also be used to add additional words to the vocabulary of the recognizer. See usage limits. List items can also be set to classes for groups of words that represent common concepts that occur in natural language. For example, rather than providing phrase hints for every month of the year, using the $MONTH class improves the likelihood of correctly transcribing audio that includes months.
repeated string phrases = 1;
| Name | Description |
| index | int The index of the value to return. |
| Type | Description |
| ByteString | The bytes of the phrases at the given index. |
getPhrasesCount()
public abstract int getPhrasesCount()
A list of strings containing words and phrases "hints" so that the speech recognition is more likely to recognize them. This can be used to improve the accuracy for specific words and phrases, for example, if specific commands are typically spoken by the user. This can also be used to add additional words to the vocabulary of the recognizer. See usage limits. List items can also be set to classes for groups of words that represent common concepts that occur in natural language. For example, rather than providing phrase hints for every month of the year, using the $MONTH class improves the likelihood of correctly transcribing audio that includes months.
repeated string phrases = 1;
| Type | Description |
| int | The count of phrases. |
getPhrasesList()
public abstract List<String> getPhrasesList()
A list of strings containing words and phrases "hints" so that the speech recognition is more likely to recognize them. This can be used to improve the accuracy for specific words and phrases, for example, if specific commands are typically spoken by the user. This can also be used to add additional words to the vocabulary of the recognizer. See usage limits. List items can also be set to classes for groups of words that represent common concepts that occur in natural language. For example, rather than providing phrase hints for every month of the year, using the $MONTH class improves the likelihood of correctly transcribing audio that includes months.
repeated string phrases = 1;
| Type | Description |
| List<String> | A list containing the phrases. |


Reading the original comment, rutherford is looking for a cross-browser way to wrap unbroken text (inferred by his use of word-wrap for IE, designed to break unbroken strings)
Reading the original comment, rutherford is looking for a cross-browser way to wrap unbroken text (inferred by his use of word-wrap for IE, designed to break unbroken strings)
Reading the original comment, rutherford is looking for a cross-browser way to wrap unbroken text (inferred by his use of word-wrap for IE, designed to break unbroken strings)


My Chemical Romance say they were not expecting such a warm welcome back following reunion announcement
“It is truly unbelievable"
My Chemical Romance have admitted they did not expect such a warm welcome back after announcing that they were reforming for the first time in six years for a reunion gig.
On Thursday (October 31), the band announced a comeback show at Los Angeles’ Shrine Expo Hall taking place on December 20. Tickets went on sale yesterday (November 1) and sold out in minutes.
Early this morning (November 2), the band took to Instagram to thank fans for the incredible reception they’ve received since announcing their return, adding that they didn’t expect it.
“It is truly unbelievable to us the happiness we have experienced over the past two days,” the post began. “From the bottom of our hearts, thank you for the warm welcome back. We truly did not expect this. See you soon. Xoxo, MCR.”
See the post below:
Since their split in 2013, band members Gerard Way, Ray Toro, Mikey Way and Frank Iero have all enjoyed success with solo and side projects.


Get in Contact with Millions of People.
It's Free and It will Always be.
Upload Your Media, and Share Your Thoughts


Playnite is an open source video game library manager with one simple goal: To provide a unified interface for all of your games.
Link games from Steam, Epic, Origin, GOG, Battle.net, Uplay, Twitch, Bethesda and itch.io, including games that are not installed! Microsoft Store (Xbox App) games are also supported. Click here for a full list of features supported from each service.
Playnite supports a wide variety of console emulators.
Playnite's look can be fully customized, from simple color changes to complete layout re-designs.
Playnite can be extended with plugins (written in .NET languages) or by scripts (PowerShell and IronPython are currently supported).
Fullscreen mode with full controller support is available.
Playnite tracks your time in-game (any game including emulated ones) and can also import your play times from Steam and GOG.
Playnite's user interface is fast and light on resources, even with large libraries.
Playnite can run from portable storage with the option to configure the database location for automatic sync via services like DropBox or Google Drive.
No Playnite features are locked behind a paywall and the complete source code is available under the MIT license.
Playnite doesn't store any user information. It stores the same amount of information as a web browser when linking accounts (cookies).
Playnite can automatically download metadata for all of your games, including custom ones (covers, descriptions and other information).


It would make sense beforehand to consider the division of tasks. In doing so, the effort should be compared with the goal to be achieved. Also, it is very important from the ground up to distribute the rollers appropriately. In addition, it would be extremely useful to create an instance that controls the progress of the project team throughout the project. In addition, a person as a product owner would be useful. This role should, if possible, be taken over by one of the organizers since there is no real client. In the classic Scrum, the product owner and the client must decide together what is developed. However, since one of the two roles does not exist at all, one should reduce this and use a sensible alternative.
Product Owner
The Prodct Owner is actually the person who makes the requirements and carries out the acceptance tests. However, implementation in such a small project is very impractical. The role would be useful to provide the student with an instance that keeps the overview or controls the progress of the team. Decrees would not have to happen as planned by the product owner, but could possibly be done by the whole team or by responsible persons. It would also be useful to divide the role to several students. In practice, it looks as if each of the customers is responsible for a completed task or the entire team is classified as a customer. Thus, several people could review the completed tasks, which would result in the project participants having a better insight into the tasks of the others. The advantage would be early detection, where there may be need for rework.
System Architect
As a system architect, you should be responsible for setting up the system architecture. This includes the choice of technology, as well as the installation and management of this technology. You should also make the preparation for domain models for the developers. For example, database models could already be created and discussed with the developers. These should then be introduced by the System Architect. The System Architect could take on the role of providing developers with the right platform. Of course, this also implies the agreement with the developers. It would be optimal if all together the requirements from the technical side to the system and the System Architect these implement.
Developer
The developers should devote themselves exclusively to the implementation of the software. Depending on the technology, different skills are required. It would be an advantage if all developers were on the same level, or if they were familiar with the same technologies. In order to be able to work as efficiently as possible, the students should be able to use CVS or Git (or GitHub) as version control. If you use these tools effectively, you can work much more effectively collaboratively. By creating different branches, each developer can work on their own sub-task.
Designer
The design students should create mockups and / or a CI which can then be implemented by some of the developers. In principle one could schedule 1 to 2 days for this task. In addition, they could help with the advertising campaign, as was currently the case in our project.


- A Message From Warren E. Buffett
- Annual & Interim ReportsUpdated November 6, 2015
- Special Letters From Warren & Charlie RE:Past, Present and Future
- Link to SEC Filings
- Links to Berkshire Subsidiary Companies
- Corporate Governance
- Owner's Manual
- Letters from Warren E. Buffett Regarding Pledges to Make Gifts of Berkshire Stock


Vice-president at Neo4j
Graph data technology is changing how we store, query and analyse our data.
In this talk, Rik will introduce you to the wonderful world of graphs, and explain where and where not to use them. He will also show a number of fascinating examples (from space exploration to cancer research), and do a live demo on a dataset that we all love.
Rik Van Bruggen is the regional vice-president for Neo4j. He has been working for startup companies for most of his career, a has been working for Neo4j for 7 years - growing it from a few dozen people to 300+ graph professionals worldwide.
He is a fond graph enthusiast, writing, blogging, podcasting, tweeting about it whenever possible. He has a fond technical interest, but really is passionate about business use cases - and about Belgian Beer.
See all speakers ›


Special thanks to the John Hopkins CSSE Github Page for making this possible! All data is used for educational purposes only.


This R package includes methods used to analyse trends in unstructured occurrence datasets and a range of useful functions for mapping such data in the UK. The package is currently under development. Note that frescalo currently uses an .exe compiled only for windows.
We are in the process of re-writing much of sparta to add in things we learnt from our recent publication (Statistics for citizen science: extracting signals of change from noisy ecological data. 2014. Nick J. B. Isaac, Arco J. van Strien, Tom A. August, Marnix P. de Zeeuw and David B. Roy).
To install the development version of sparta, it’s easiest to use the devtools
package:
# install.packages("devtools")
# NOTE: If you have not installed devtools before you will need to restart you R
# session before installing to avoid problems
library(devtools)
# Some users have reported issues with devtools not correctly installing
# dependencies. Run the following lines to avoid these issues
list.of.packages <- c("minqa", "lme4", "gtools", "gtable", "scales",
"assertthat", "magrittr", "tibble", "stringr")
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
# Now install sparta
install_github('BiologicalRecordsCentre/sparta')
# Load sparta
library(sparta)
If you have difficulties installing sparta using this method try updating your version of R to the most up-to-date version available. If you still have problems please contact us or use the issues page.
We have written a vignette to support the package which can view here
PLEASE NOTE THAT SINCE THIS PACKAGE IS IN DEVELOPMENT THE STRUCTURE AND FUNCTIONALITY OF THE PACKAGE ARE LIKELY TO CHANGE OVER TIME. WE WILL TRY TO KEEP THIS FRONT PAGE AND TUTORIALS UP TO DATE SO THAT IT WORKS WITH THE CURRENT MASTER VERSION ON GITHUB


MIDI Tuning Standard
Patch Editor
This is a tool designed to make create different tunings and scales and to upload them to and request them from synthesizers which support the MIDI Tuning Standard (or MTS). You can save your tunings as sysex patches.
Communicating with Edisyn
Synthesizers which adhere to MTS all have a device number. You must set the Synth ID in Edisyn's MIDI Devices window (see the "Change MIDI" menu) to be the same as your synth's MTS device number.
About the Tuning Dials 0 ... 127
MTS assigns a pitch to every MIDI note value from 0...127. Each of these knob pairs represents the frequency to assign to that value.
You compute the pitch by choosing an original note from the 12-tone-equal-temperment (A4-440hz standard modern western tuning) as well as an offset in cents from 0-100 above that note. Your resolution in cents is 100/216. The knob panel as it stands is a direct representation of the midi tuning standard sysex and allows you to manually input your desired values. However, this is not the recommended way to set these values. The Tuning menu option has utilities for calculating these knobs in bulk.
Tuning Utilities
The Tuning menu gives access to various utilities to make it easy to set different common tunings.
Load Scala File...
You can load tunings in the popular Scala format. These files end in ".scl" or ".SCL". Scala tunings are relative: you'll also need to specify what the root MIDI note and Root Frequency are.
EDO
EDO stands for Equal number of Divisions per Octave and is also commonly known as Equal Temperament. You'll also see the acronyms "ET" or "TET". Standard western tuning is EDO with A4 (MIDI note 69) set to 440hz, at 12 divisions per octave. Other tunings have their advantages and disadvantages and a decent summary of the topic can be found on Wikipedia. The calculate button gives the frequency of the selected midi number in standard western tuning, but feel free to use any positive number for frequncy for any midi note number as your root, all it is saying is "I want midi number x from my controller to equate to frequency y and to tune the rest of the notes using equal temperment with z divisons per octave."
Named Scales
These are scales that are either popular enough or notable enough to be named. You can find out more about them on Wikipedia. Many of these scales are standard scales found in the MTS presets on Yamaha 4-operator synthesizers such as the TX81Z. These are set up much in the same way that you set up EDO above.
| By
| Bryan Hoyle
With Sean Luke
|
| Date
| April 2020
|


Emmerdale's Jacob kicked out of village by dad after vile sex comments
Teen Jacob has descended into a downward spiral ever since he began being groomed by teacher Maya Stepney
by Irishmirror.ieJacob Gallagher has finally gone too far for his dad on Emmerdale, which results in him being him out of the house in an explosive twist tonight.
The teen, who has descended into a downward spiral ever since he began being groomed by teacher Maya Stepney.
And things got even worst when Maya was jailed and Jacob struggled to deal with the fact that he was groomed.
After hearing that Maya had been released from prison, Jacob's bad behaviour began escalating again and led him to sleep with Leanna.
Following this, Jacob acted coldly towards her and left her upset. Her dad Dr Liam Cavanagh discovered what had happened and punched Jacob in a fit of anger.
Tonight, Jacob is confronted by his dad, granddad and mum, but he doesn't take it well.
"We can't go on like this," David tells his son in a clip from tonight's episode.
Jacob snaps: "I don't need another lecture."

"You've hurt too many people," David tells him. "And we love you but we just can't cope with you.
"I want you to leave."
This comes just after revelation that Maya is pregnant, which no one in the village currently knows about.
Will Jacob and David find out about the baby when their relationship is at its lowest point?
*Emmerdale airs tonight at 7pm on ITV


"VINEGAR" Hebrews hometz, Gr. oxos, Fr. vin aigre; i.e., “sour wine.” The Hebrew word is rendered vinegar in Psalm 69:21, a prophecy fulfilled in the history of the crucifixion (Matthew 27:34). This was the common sour wine (posea) daily made use of by the Roman soldiers. They gave it to Christ, not in derision, but from compassion, to assuage his thirst. Proverbs 10:26 shows that there was also a stronger vinegar, which was not fit for drinking. The comparison, “vinegar upon nitre,” probably means“vinegar upon soda” (as in the marg. of the R.V.), which then effervesces.
"VINEGAR" Hebrews hometz, Gr. oxos, Fr. vin aigre; i.e., “sour wine.” The Hebrew word is rendered vinegar in Psalm 69:21, a prophecy fulfilled in the history of the crucifixion (Matthew 27:34). This was the common sour wine (posea) daily made use of by the Roman soldiers. They gave it to Christ, not in derision, but from compassion, to assuage his thirst.
Proverbs 10:26 shows that there was also a stronger vinegar, which was not fit for drinking. The comparison, “vinegar upon nitre,” probably means“vinegar upon soda” (as in the marg. of the R.V.), which then effervesces.


Emmerdale's Charity and Vanessa WILL get married confirms Michelle Hardwick
It's not all over for Vanity
by Entertainment DailyVanity fans can breathe a sigh of relief for Emmerdale's Charity and Vanessa.
The fan favourite couple WILL get married despite their current split, actress Michelle Hardwick has confirmed.
Read more: Gaynor Faye hints at return to Emmerdale just months after quitting
In a new chat for the Sunday Mirror, Michelle spoke about the relationship for the couple and let slip the wedding is very much still on.
She said: "If Emmerdale weddings are anything to go by, it can't just go smoothly, can it? I'd be very shocked if it did."
The couple split up last week when Vanessa discovered Charity had lied to her about the casino scam and tried to buy a house without her knowledge.
After Charity swore the money she had was from hard work and wasn't at all dodgy, the pair agreed to buy the house together.
But Vinny soon ruined their plans and kept hinting to Vanessa that Charity was involved in a scam.
Vanessa gave Charity the chance to come clean, but she didn't.
Read more: Emmerdale's Bob ignored by fans as they flock to Kim Tate
Furious with her fiancée for lying, Vanessa broke off their engagement, ending their relationship, as well as outing Charity's involvement in the scam to the rest of the Dingles.
It left Vanity fans heartbroken and they flocked to Twitter to share their emotional reactions.
One said: "Guys I’m not ok. That was honestly soul destroying but the acting👌 but it’s so sad😭 Vanessa’s little face😭 please don’t let this be the end. 😭🙏 #vanity #emmerdale @emmerdale".

A third said: "😭😭😭😭😭😭😭😭😭😭😭😭 #Emmerdale vanity Vanessa saying is over 💔😭😭😭😭".
Are you happy the couple will reunite? Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think!


--- title: Len Payne layout: default ---
Len Payne is a Software Developer, IT Professional and Coach in Sarnia, Ontario, Canada. He is currently the Chief Technology Officer at Link2Feed, a SaaS provider based out of Sarnia and Detroit, which helps food banks and other poverty-relief organizations in managing their caseloads. Through Lambton College, Len has taught a variety of courses from systems administration to software development and project management. Len also actively participates in Applied Research at the College, as well as entrepreneurship activities through Cube and The Sarnia Tech Community. Len is a proud founder of the Sarnia-Lambton Linux Users Group.


{% include "beaker_tracking.html" %}
Beaker - The data scientist's laboratory
Open gist
Download notebook
{% include "beaker_footer.html" %}


This lesson provides an introduction to Graphical User Interface (GUI) programming with Swing and the NetBeans IDE. As you learned in the "Hello World!" lesson, the NetBeans IDE is a free, open-source, cross-platform integrated development environment with built-in support for the Java programming language. It offers many advantages over coding with a text editor; we recommend its use whenever possible. If you have not yet read the above lesson, please take a moment to do so now. It provides valuable information about downloading and installing the JDK and NetBeans IDE.
The goal of this lesson is to introduce the Swing API by designing a simple application that converts temperature from Celsius to Fahrenheit. Its GUI will be basic, focusing on only a subset of the available Swing components. We will use the NetBeans IDE GUI builder, which makes user interface creation a simple matter of drag and drop. Its automatic code generation feature simplifies the GUI development process, letting you focus on the application logic instead of the underlying infrastructure.
Because this lesson is a step-by-step checklist of specific actions to take, we recommend that you run the NetBeans IDE and perform each step as you read along. This will be the quickest and easiest way to begin programming with Swing. If you are unable to do so, simply reading along should still be useful, since each step is illustrated with screenshots.
If you prefer the traditional approach of programming each component manually (without the assistance of an IDE), think of this lesson as an entry point into the lower-level discussions already provided elsewhere in the tutorial. Hyperlinks in each discussion will take you to related lessons, should you wish to learn such lower-level details.
The finished GUI for this application will look as follows:The CelsiusConverter Application.
From an end-user's perspective, usage is simple: enter a temperature (in Celsius) into the text box, click the "Convert" button, and watch the converted temperature (in Fahrenheit) appear on screen. The minimize, maximize, and close buttons will behave as expected, and the application will also have a title that appears along the top of the window.
From a programmer's perspective, we will write the application in two main stages. First, we will populate the GUI with the various Swing components and arrange them as shown above. Then, we will add the application logic, so that the program actually performs a conversion when the user presses the "Convert" button.


Educational Entertainment for Kids
Smarty Kid Party is where kids and parents both win! Get ready for a fun hour of trendy learning experiences for your little ones!
One hour events designed to entertain your little ones
$125 for set-up, activities, and prizes
Music and games promoting all areas of development
M.Ed instructor with experience with kids with special needs


Modern, easy to use styleguide definition.
This guide defines a set of rules and coding conventions to create and structure the UI of your application. The goal is to improve the communication between designers, developers and product managers.
$primaryColor
#445878
$highlightColor
#92C9CF
$accentColor
#31353D
$darkColor
#1C1D21
$lightColor
#EEEFF7
Source Sans Pro
This is a paragraph. Morbi tristique senectus et netus et malesuada fames ac turpis egestas. (16px)


This is a binding Agreement between the Merit Foundation. (“Merit Foundation” or “We”) and the person, persons, or entity (“You” or “Your”) using the service, Software, or application (“Software”).
RIGHTS AND OBLIGATIONS
Merit Foundation provides the Software solely on the terms and conditions set forth in this Agreement and on the condition that You accept and comply with them. By using the Software You (a) accept this Agreement and agree that You are legally bound by its terms; and (b) represent and warrant that: (i) You are of legal age to enter into a binding agreement; and (ii) if You are a corporation, governmental organization or other legal entity, You have the right, power and authority to enter into this Agreement on behalf of the corporation, governmental organization or other legal entity and bind them to these terms.
This Software functions as a free, open source, and multi-signature digital wallet. The Software does not constitute an account where We or other third parties serve as financial intermediaries or custodians of Your MRT.
While the Software has undergone beta testing and continues to be improved by feedback from the open-source user and developer community, We cannot guarantee there will not be bugs in the Software. You acknowledge that Your use of this Software is at Your own discretion and in compliance with all applicable laws. You are responsible for safekeeping Your passwords, private key pairs, PINs, and any other codes You use to access the Software.
 All transaction requests are irreversible. The authors of the Software, employees and affiliates of Merit Foundation, copyright holders, and the Merit Foundation. cannot retrieve Your private keys or passwords if You lose or forget them and cannot guarantee transaction confirmation as they do not have control over the Merit network.
 IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE, EMPLOYEES AND AFFILIATES OF Merit Foundation, COPYRIGHT HOLDERS, OR Merit Foundation, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

INTELLECTUAL PROPERTY
We retain all right, title, and interest in and to the Content and all of Merit Foundation’s brands, logos, and trademarks, including, but not limited to, the Merit Foundation., Merit Foundation, Merit Foundation – Secure Merit Wallet, Merit Foundation Wallet, Merit LightWallet, Merit Wallet, Merit Foundation App, and variations of the wording of the aforementioned brands, logos, and trademarks.
CHOICE OF LAW
This Agreement, and its application and interpretation, shall be governed exclusively by the laws of Singapore, without regard to its conflict of law rules. You consent to the exclusive jurisdiction of the courts of Singapore.
SEVERABILITY
In the event any court shall declare any section or sections of this Agreement invalid or void, such declaration shall not invalidate the entire Agreement and all other paragraphs of the Agreement shall remain in full force and effect.
BINDING AGREEMENT
The terms and provisions of this Agreement are binding upon Your heirs, successors, assigns, and other representatives. This Agreement may be executed in counterparts, each of which shall be considered to be an original, but both of which constitute the same Agreement.
You assume any and all risks associated with the use of the Software. We reserve the right to modify this Agreement from time to time.


Multi uploader example
fileUploader 1
fileUploader 2
In this example "save" button will log the loaded files in console;
then you have to handle these results (ex. sending them to a remote procedure using ajax)...
Get Total Size 1 Get Total Size 2


@@include( '../includes/popup.html')
@@include( '../includes/menu.html')
@@include( '../includes/main_inner.html')
@@include( '../includes/footer.html')


Alpha models are intended to be easy to create and the primary location for iterating your strategy. To create Alpha Models, you must implement the $[IAlphaModel,T:QuantConnect.Algorithm.Framework.Alphas.IAlphaModel] interface as shown in the examples below. This has two methods:
1. $[Update(),M:QuantConnect.Algorithm.Framework.Alphas.AlphaModel.Update] - Generate Insight objects.
2. $[OnSecuritiesChanged(),M:QuantConnect.Algorithm.Framework.Alphas.AlphaModel.OnSecuritiesChanged] - Receive notifications about security changes.
// Algorithm framework model that produces insights class MyAlphaModel : IAlphaModel, INotifiedSecurityChanges { // Updates this alpha model with the latest data from the algorithm. // This is called each time the algorithm receives data for subscribed securities Insight[] Update(QCAlgorithm algorithm, Slice data) { // Generate insights on the securities in universe. } void OnSecuritiesChanged(QCAlgorithm algorithm, SecurityChanges changes) { // Handle security changes in from your universe model. } }
# Algorithm framework model that produces insights class MyAlphaModel: def Update(self, algorithm, slice): # Updates this alpha model with the latest data from the algorithm. # This is called each time the algorithm receives data for subscribed securities # Generate insights on the securities in the universe. insights = [] return insights def OnSecuritiesChanged(self, algorithm, changes): # Handle security changes in from your universe model.
You can access all the normal QCAlgorithm messages such as Log
, and Debug
from the algorithm object; for example logging is located at algorithm.Log("message")
. The slice
parameter contains the latest data available to the algorithm.


Fibonacci sequence:
| 0, | 1, | 1, | 2, | 3, | 5, | 8, | 13, | 21, | 34 | … |
| 0, | + 1, | = 1, | ||||||||
| 1, | + 1, | = 2, | ||||||||
| 1, | + 2, | = 3, | ||||||||
| 2, | + 3, | = 5, |
Fibonacci sequence:
| 0, | 1, | 1, | 2, | 3, | 5, | 8, | 13, | 21, | 34 | … |
Fibonacci sequence:
def fib(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fib(n - 1) + fib(n - 2)
In [1]: from fib import fib
In [2]: fib(1)
Out[2]: 1
In [3]: fib(3)
Out[3]: 2
In [4]: fib(4)
Out[4]: 3
In [5]: fib(5)
Out[5]: 5
In [6]: assert fib(2) == 1
In [7]: assert fib(5) == 5
In [8]: assert fib(6) == 8
In [9]: %save test_fib.py 1 6-8
# I can now re-run these tests whenever I want!
./test_fib.py
A function or class with the following structure:
employee = Employee('John', 'Doe')
employee.state = 'TN'
employee.city = 'Nashville'
employee.salary = 56516
employee = Employee('John', 'Doe')
employee.state = 'TN'
employee.city = 'Nashville'
employee.salary = 56516
payroll = employee.calculate_payroll()
employee = Employee('John', 'Doe')
employee.state = 'TN'
employee.city = 'Nashville'
employee.salary = 56516
payroll = employee.calculate_payroll()
assert payroll.withheld == 5000
The Three Laws of TDD
(Test Driven Development)
Unit tests run fast. If they don't run fast, they aren't unit tests.
Other kinds of tests often masquerade as unit tests. A test is not a unit test if:
[I'm] lazy, as all good engineers are wont to be.  Being lazy means you don't want to ever make the same mistake twice. Being lazy means making your compiler(s) work as hard as possible, so that you don't have to… If you treat it well, you can make the compiler your right-hand man, helper, conscience, your batman.
  Being lazy means you don't want to ever make the same mistake twice. Being lazy means making your compiler(s) work as hard as possible, so that you don't have to… If you treat it well, you can make the compiler your right-hand man, helper, conscience, your batman.
All the ways our industry has improved our feedback…
And automated testing
from fib import fib
import unittest
class FibTestCase(unittest.TestCase):
def test_fib(self):
self.assertEqual(fib(1), 1)
self.assertEqual(fib(2), 1)
self.assertEqual(fib(3), 2)
self.assertEqual(fib(4), 3)
self.assertEqual(fib(5), 5)
if __name__ == '__main__':
unittest.main()
from fib import fib
import unittest
class FibTestCase(unittest.TestCase):
def test_fib(self):
self.assertEqual(fib(1), 1)
self.assertEqual(fib(2), 1)
self.assertEqual(fib(3), 2)
self.assertEqual(fib(4), 3)
self.assertEqual(fib(5), 5)
if __name__ == '__main__':
unittest.main()
from fib import fib
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(3) == 2
assert fib(4) == 3
assert fib(5) == 5
pip install pytest
pytest
instead of ./my_test_suite.py
(or use unittest2pytest)
By default:
test_*.py
or *_test.py
Test
test_
assertEqual
assertNotEqual
assertTrue
assertFalse
assertIs
assertIsNot
assertIsNone
assertIsNotNone
assertIn
assertNotIn
assertIsInstance
assertIsNotInstance
assertAlmostEqual
assertNotAlmostEqual
assertGreater
assertGreaterEqual
assertLess
assertLessEqual
assertRegex
assertNotRegex
assert
pytest inspects the Abstract Syntax Tree (AST) to turn this…
a = 1
b = 2
assert a + b == 3
…into this.
@py_assert0 = 1
@py_assert2 = 2
@py_assert4 = @py_assert0 + @py_assert2
@py_assert6 = 3
@py_assert5 = @py_assert4 == @py_assert6
if not @py_assert5:
@py_format8 = @pytest_ar._call_reprcompare(('==',), \
(@py_assert5,), ('(%(py1)s + %(py3)s) == %(py7)s',), \
(@py_assert4, @py_assert6)) % {
'py3': @pytest_ar._saferepr(@py_assert2),
'py1': @pytest_ar._saferepr(@py_assert0),
'py7': @pytest_ar._saferepr(@py_assert6)}
@py_format10 = ('' + 'assert %(py9)s') % {'py9': @py_format8}
raise AssertionError(@pytest_ar._format_explanation(@py_format10))
@py_assert0 = @py_assert2 = @py_assert4 = @py_assert5 = @py_assert6 = None
(You are not expected to understand this.)
a = 1
b = 2
assert a + b == 4
Sample output:
a = 1
b = 2
> assert a + b == 4
E assert (1 + 2) == 4
actual = {'first_name': 'John', 'last_name': 'Doe',
'city': 'Nashville', 'state': 'TN'}
expected = {'first_name': 'John', 'last_name': 'Doe',
'city': 'Memphis', 'state': 'TN'}
assert actual == expected
Sample output:
> assert actual == expected
E AssertionError: assert {'city': 'Nas...'state': 'TN'} == {'city': 'Knox...'state': 'TN'}
E Omitting 3 identical items, use -vv to show
E Differing items:
E {'city': 'Nashville'} != {'city': 'Memphis'}
E Use -v to get the full diff
pip install pytest-cov
pytest --cov=. --cov-report=html:../cov_html
Run ptw
, and your tests will be automatically executed whenever your code changes.
Run tests across multiple CPUs or hosts.
Run tests repeatedly on file change (similar to pytest-watch).
Run tests on multiple environments.
Optionally, install PDB++ or pudb:
pip install pdbpp
Manually set a breakpoint:
import pdb; pdb.set_trace()
breakpoint() # Python 3.7 only
Or break on the first failure:
pytest --pdb -x
Report the 3 slowest tests, so that you know what to work on:
pytest --durations=3
pytest test_notepad.py
pytest test_notepad.py::TestFileIO::test_save
def test_negative_numbers():
with pytest.raises(ValueError):
fib(-1)
import pytest
@pytest.fixture
def smtp_connection():
import smtplib
return smtplib.SMTP("smtp.gmail.com", 587, timeout=5)
def test_ehlo(smtp_connection):
response, msg = smtp_connection.ehlo()
assert response == 250
import my_api_client
import pytest
import requests_mock
@pytest.fixture
def m():
with requests_mock.Mocker() as m:
yield m
def test_api_client(m):
# Tell the mock to expect a request for www.example.com
# and send a reply of "Hello, world!" back.
m.get('http://www.example.com', content='Hello, world!')
# Execute the code under test.
response = my_api_client.query()
# Verify that our mock object was called.
assert m.called
assert m.call_count == 1
assert response == 'Hello, world!'
@pytest.fixture
def notepad():
notepad = pywinauto.Application().start('notepad.exe')
yield notepad
notepad.close()
def test_copy(notepad):
notepad.UntitledNotepad.Edit.type_keys('Hello')
notepad.UntitledNotepad.Edit.type_keys('^A^C')
assert pywinauto.clipboard.GetData() == 'Hello'
“Professionalism and Test-Driven Development,” Robert C. Martin, IEEE Software, Vol. 24, Issue 3
UnitTest and SelfTestingCode, Martin Fowler
Why Most Unit Testing is Waste, James O. Copelien
TDD is dead. Long live testing, David Heinemeier Hansson
Just Say No to More End-to-End Tests, Mike Wacker
Write tests. Not too many. Mostly integration, Kent C. Dodds
“Fibonacci Number,” Wikipedia
The Dark Knight © Warner Bros. 2017.
The Lord of the Rings film trilogy © New Line Cinema 2001, 2002, 2003


The Lincoln town Car Executive L Series has an extended wheel base (6 inches longer than the standard Town Car) that provides rear seat passengers with additional legroom and maximum comfort. The rear seat amenities include climate controls, radio controls, front passenger seat controls, reading lamps and illuminated vanity mirrors.
View CarThe Mercedes-Benz S-Class is as synonymous with state-of-the-art luxury and safety features as it is with country club prestige. As Mercedes' largest sedan, the S-Class offers the most room for rear-seat passengers, making it a favorite of wealthy dads and heads of state alike. The S550 is a full size luxury vehicle that articulates sophistication and class.
View CarThe Maybach 62, with overwhelming power and over-the-top opulence, is a more modern take on the ultra-luxurious sedan. Indulgent in its luxurious decadence, constructed like a leather-lined bank vault, bespoke exclusivity, beautiful ride, supremely powerful. Maybach has active self-leveling suspension, adaptive cruise control, a rear-cabin sunroof, power rear sunshades, a full leather interior, two-person reclining rear bucket heated seats with memory, power leg supports and footrests, folding rear picnic tables, electronic rear-door closers, four-zone climate control with active air filter and a rear beverage cooler.
View CarThis beautifully hand crafted and elegant ultra luxury sedan lives up to the lofty expectations of a vehicle adorned with the hood-mounted Spirit of Ecstasy, with soft black leather upholstery is edged with Seashell piping. Black ash wood veneers are used throughout and while dark in finish, still allow the natural grain to show through. A silver pinstripe adorns each door capping. The dashboard is finished in special black metal foil with a finely embossed diamond pattern.
View CarThe R-Class is a crossover vehicle engineered to accommodate up to seven passengers, and does so with exceeding luxury, safety, comfort, and space. It can accommodate up to seven passengers in comfort, with three rows of seating, four conventional doors and a top-hinged rear lift-gate for easy access to the cargo area.
View Car


microscheme.org
A functional programming language for the Arduino
Microscheme, or (ms) for short, is a functional programming language for the Arduino, and for Atmel 8-bit AVR microcontrollers in general. Microscheme is a subset of Scheme, in the sense that every valid (ms) program is also a valid Scheme program (with the exception of Arduino hardware-specific primitives). The (ms) compiler performs function inlining, and features an aggressive tree-shaker, eliminating unused top-level definitions. Microscheme has a robust FFI (Foreign Function Interface) meaning that C code may be invoked directly from (ms) programs. Therefore, the power of the existing wealth of Arduino libraries is available within Microscheme.


Who am I?
Sergi Almacellas Abellana
- (Python ♥) Programmer
- Open source enthusiast
- Tryton commiter since Nov 2013
What's a web application?
- Different UI
- Password-less
- Accessing same data
- Same user (and access)
What's a web portal?
- Different UI
- External user and password
- Accessing same data
- Can provide more restricted access
Demo
- Planning web application
- Customer projects portal


XHTML, HTML, CSS and Dreamweaver
XHTML is currently the web coding standard named by the W3C. HTML5 has been published is continuing to be developed. It is likely to become the next web coding standard. CSS is a coding language to control the format or presentation of web pages. CSS allows you to separate the content codes and the formatting codes in a website. This makes it much easier to make site-wide changes. Many web coders use web authoring programs like Dreamweaver to streamline the coding process.
Accessibility Guidelines
Guidelines have been created to make websites accessible to people with disabilities. The guidelines also make Web content more available to all users. An example of an accessibility rule is to provide a text equivalent for every non-text element. For images, you must include the alt attribute or longdesc to provide a text alternative for the image.
Search Engine Optimization
Search Engine Optimization refers to creating pages that are search engine friendly. Search engines will be more likely to include your pages high in a search results list if they are accurately coded and are full of well written content. Google provides tips to webmasters for improving the SEO of a website.


var b = 10; var c = b; // c has the value 10 b = b + c; // the expression b + c is "evaluated" // and b is assigned the result ie 20


Here you can find friends or stalk strangers The Doge Social Network does not take any responsibility for the information found.


models¶
All base models available in OpenSeq2Seq.
model¶
-
class
models.model.
Model
(params, mode='train', hvd=None)[source]¶ Bases:
object
Abstract class that any model should inherit from. It automatically enables multi-GPU (or Horovod) computation, has mixed precision support, logs training summaries, etc.
-
__init__
(params, mode='train', hvd=None)[source]¶ Model constructor. The TensorFlow graph should not be created here, but rather in the
self.compile()
method.Parameters: - params (dict) – parameters describing the model.
All supported parameters are listed in
get_required_params()
,get_optional_params()
functions. - mode (string, optional) – “train”, “eval” or “infer”. If mode is “train” all parts of the graph will be built (model, loss, optimizer). If mode is “eval”, only model and loss will be built. If mode is “infer”, only model will be built.
- hvd (optional) – if Horovod is used, this should be
horovod.tensorflow
module. If Horovod is not used, it should be None.
Config parameters:
- random_seed (int) — random seed to use.
- use_horovod (bool) — whether to use Horovod for distributed execution.
- num_gpus (int) — number of GPUs to use. This parameter cannot be
used if
gpu_ids
is specified. Whenuse_horovod
is True this parameter is ignored. - gpu_ids (list of ints) — GPU ids to use. This parameter cannot be
used if
num_gpus
is specified. Whenuse_horovod
is True this parameter is ignored. - batch_size_per_gpu (int) — batch size to use for each GPU.
- num_epochs (int) — number of epochs to run training for.
This parameter cannot be used if
max_steps
is specified. - max_steps (int) — number of steps to run training for.
This parameter cannot be used if
num_epochs
is specified. - save_summaries_steps (int or None) — how often to save summaries. Setting it to None disables summaries saving.
- print_loss_steps (int or None) — how often to print loss during training. Setting it to None disables loss printing.
- print_samples_steps (int or None) — how often to print training samples (input sequences, correct answers and model predictions). Setting it to None disables samples printing.
- print_bench_info_steps (int or None) — how often to print training benchmarking information (average number of objects processed per step). Setting it to None disables intermediate benchmarking printing, but the average information across the whole training will always be printed after the last iteration.
- save_checkpoint_steps (int or None) — how often to save model checkpoints. Setting it to None disables checkpoint saving.
- eval_steps (int) — how often to run evaluation during training.
This parameter is only checked if
--mode
argument ofrun.py
is “train_eval”. If no evaluation is needed you should use “train” mode. - logdir (string) — path to the log directory where all checkpoints and summaries will be saved.
- data_layer (any class derived from
DataLayer
) — data layer class to use. - data_layer_params (dict) — dictionary with data layer configuration. For complete list of possible parameters see the corresponding class docs.
- optimizer (string or TensorFlow optimizer class) — optimizer to use for training. Could be either “Adam”, “Adagrad”, “Ftrl”, “Momentum”, “RMSProp”, “SGD” or any valid TensorFlow optimizer class.
- optimizer_params (dict) — dictionary that will be passed to
optimizer
__init__
method. - initializer — any valid TensorFlow initializer.
- initializer_params (dict) — dictionary that will be passed to
initializer
__init__
method. - regularizer — and valid TensorFlow regularizer.
- regularizer_params (dict) — dictionary that will be passed to
regularizer
__init__
method. - dtype — model dtype. Could be either
tf.float16
,tf.float32
or “mixed”. For details see mixed precision training section in docs. - lr_policy — any valid learning rate policy function. For examples,
see
optimizers.lr_policies
module. - lr_policy_params (dict) — dictionary containing lr_policy parameters.
- max_grad_norm (float) — maximum value of gradient norm. Clipping will be performed if some gradients exceed this value (this is checked for each variable independently).
- loss_scaling — could be float or string. If float, static loss scaling is applied. If string, the corresponding automatic loss scaling algorithm is used. Must be one of ‘Backoff’ of ‘LogMax’ (case insensitive). Only used when dtype=”mixed”. For details see mixed precision training section in docs.
- loss_scaling_params (dict) — dictionary containing loss scaling parameters.
- summaries (list) — which summaries to log. Could contain “learning_rate”, “gradients”, “gradient_norm”, “global_gradient_norm”, “variables”, “variable_norm”, “loss_scale”.
- iter_size (int) — use this parameter to emulate large batches.
The gradients will be accumulated for
iter_size
number of steps before applying update. - larc_params — dictionary with parameters for LARC (or LARS)
optimization algorithms. Can contain the following parameters:
- larc_mode — Could be either “scale” (LARS) or “clip” (LARC). Note that it works in addition to any other optimization algorithm since we treat it as adaptive gradient clipping and learning rate adjustment.
- larc_eta (float) — LARC or LARS scaling parameter.
- min_update (float) — minimal value of the LARC (LARS) update.
- epsilon (float) — small number added to gradient norm in denominator for numerical stability.
- params (dict) – parameters describing the model.
All supported parameters are listed in
-
_build_forward_pass_graph
(input_tensors, gpu_id=0)[source]¶ This method should create the graph of the forward pass of the model.
Parameters: - input_tensors –
input_tensors
defined by the data_layer class. - gpu_id (int, optional) – id of the GPU where the current copy of the model is constructed. For Horovod this is always zero.
Returns: tuple containing loss tensor and list of outputs tensors.
Loss tensor will be automatically provided to the optimizer and corresponding
train_op
will be created.Samples tensors are stored in the
_outputs
attribute and can be accessed by callingget_output_tensors()
function. For example, this happens insideutils.hooks.RunEvaluationHook
to fetch output values for evaluation.Both loss and outputs can be None when corresponding part of the graph is not built.
Return type: tuple
- input_tensors –
-
_get_num_objects_per_step
(worker_id=0)[source]¶ Define this method if you need benchmarking functionality. For example, for translation models, this method should return number of tokens in current batch, for image recognition model should return number of images in current batch.
Parameters: worker_id (int) – id of the worker to get data layer from (not used for Horovod). Returns: tf.Tensor with number of objects in batch.
-
clip_last_batch
(last_batch, true_size)[source]¶ This method performs last batch clipping. Used in cases when dataset is not divisible by the batch size and model does not support dynamic batch sizes. In those cases, the last batch will contain some data from the “next epoch” and this method can be used to remove that data. This method works for both dense and sparse tensors. In most cases you will not need to overwrite this method.
Parameters: - last_batch (list) – list with elements that could be either
np.array
ortf.SparseTensorValue
containing data for last batch. The assumption is that the first axis of all data tensors will correspond to the current batch size. - true_size (int) – true size that the last batch should be cut to.
- last_batch (list) – list with elements that could be either
-
evaluate
(input_values, output_values)[source]¶ This method can be used in conjunction with
self.finalize_evaluation()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that this function is not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting this function can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for evaluation finalization (e.g. accuracy on current batch, which will then be averaged in finalization method).
Return type: list
- input_values – evaluation of
-
finalize_evaluation
(results_per_batch, training_step=None)[source]¶ This method can be used in conjunction with
self.evaluate()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that these methods are not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting these methods can be a useful way to add it.Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - training_step (int) – current training step. Will only be passed if mode is “train_eval”.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- results_per_batch (list) – aggregation of values returned from all calls
to
-
finalize_inference
(results_per_batch, output_file)[source]¶ This method should be implemented if the model support inference mode. For example for speech-to-text and text-to-text models, this method will log the corresponding input-output pair to the output_file.
Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - output_file (str) – name of the output file that inference results should be saved to.
- results_per_batch (list) – aggregation of values returned from all calls
to
-
get_data_layer
(worker_id=0)[source]¶ Returns model data layer. When using Horovod,
worker_id
parameter is ignored. When using tower-based multi-GPU approach,worker_id
can be used to select data layer for corresponding tower/GPU.Parameters: worker_id (int) – id of the worker to get data layer from (not used for Horovod). Returns: model data layer.
-
static
get_optional_params
()[source]¶ Static method with description of optional parameters.
Returns: Dictionary containing all the parameters that can be included into the params
parameter of the class__init__()
method.Return type: dict
-
get_output_tensors
(worker_id=0)[source]¶ Returns output tensors generated by
_build_forward_pass_graph.()
When using Horovod,worker_id
parameter is ignored. When using tower-based multi-GPU approach,worker_id
can be used to select tensors for corresponding tower/GPU.Parameters: worker_id (int) – id of the worker to get tensors from (not used for Horovod). Returns: output tensors.
-
static
get_required_params
()[source]¶ Static method with description of required parameters.
Returns: Dictionary containing all the parameters that have to be included into the params
parameter of the class__init__()
method.Return type: dict
-
hvd
¶ horovod.tensorflow module
-
infer
(input_values, output_values)[source]¶ This method is analogous to
self.evaluate()
, but used in conjunction withself.finalize_inference()
to perform inference.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for inference finalization (e.g. this method can return final generated sequences for each batch which will then be saved to file in
self.finalize_inference()
method).Return type: list
- input_values – evaluation of
-
last_step
¶ Number of steps the training should be run for.
-
maybe_print_logs
(input_values, output_values, training_step)[source]¶ This method can be used to print logs that help to visualize training. For example, you can print sample input sequences and their corresponding predictions. This method will be called every
print_samples_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors. Note that this method is not abstract and does not have to be implemented in derived classes. But if additional printing functionality is required, overwriting this method can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer(0).input_tensors
, that is, input tensors for one batch on the first GPU. - output_values – evaluation of
self.get_output_tensors(0)
, that is, output tensors for one batch on the first GPU. - training_step (int) – Current training step.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- input_values – evaluation of
-
mode
¶ Mode the model is executed in (“train”, “eval” or “infer”).
-
num_gpus
¶ Number of GPUs the model will be run on. For Horovod this is always 1 and actual number of GPUs is controlled by Open-MPI parameters.
-
on_horovod
¶ Whether the model is run on Horovod or not.
-
params
¶ Parameters used to construct the model (dictionary).
-
steps_in_epoch
¶ Number of steps in epoch. This parameter is only populated if
num_epochs
was specified in the config (otherwise it is None). It is used in training hooks to correctly print epoch number.
-
encoder_decoder¶
-
class
models.encoder_decoder.
EncoderDecoderModel
(params, mode='train', hvd=None)[source]¶ Bases:
open_seq2seq.models.model.Model
Standard encoder-decoder class with one encoder and one decoder. “encoder-decoder-loss” models should inherit from this class.
-
__init__
(params, mode='train', hvd=None)[source]¶ Encoder-decoder model constructor. Note that TensorFlow graph should not be created here. All graph creation logic is happening inside
self._build_forward_pass_graph()
method.Parameters: - params (dict) – parameters describing the model.
All supported parameters are listed in
get_required_params()
,get_optional_params()
functions. - mode (string, optional) – “train”, “eval” or “infer”. If mode is “train” all parts of the graph will be built (model, loss, optimizer). If mode is “eval”, only model and loss will be built. If mode is “infer”, only model will be built.
- hvd (optional) – if Horovod is used, this should be
horovod.tensorflow
module. If Horovod is not used, it should be None.
Config parameters:
- encoder (any class derived from
Encoder
) — encoder class to use. - encoder_params (dict) — dictionary with encoder configuration. For complete list of possible parameters see the corresponding class docs.
- decoder (any class derived from
Decoder
) — decoder class to use. - decoder_params (dict) — dictionary with decoder configuration. For complete list of possible parameters see the corresponding class docs.
- loss (any class derived from
Loss
) — loss class to use. - loss_params (dict) — dictionary with loss configuration. For complete list of possible parameters see the corresponding class docs.
- params (dict) – parameters describing the model.
All supported parameters are listed in
-
_build_forward_pass_graph
(input_tensors, gpu_id=0)[source]¶ TensorFlow graph for encoder-decoder-loss model is created here. This function connects encoder, decoder and loss together. As an input for encoder it will specify source tensors (as returned from the data layer). As an input for decoder it will specify target tensors as well as all output returned from encoder. For loss it will also specify target tensors and all output returned from decoder. Note that loss will only be built for mode == “train” or “eval”.
Parameters: - input_tensors (dict) –
input_tensors
dictionary that has to containsource_tensors
key with the list of all source tensors, andtarget_tensors
with the list of all target tensors. Note thattarget_tensors
only need to be provided if mode is “train” or “eval”. - gpu_id (int, optional) – id of the GPU where the current copy of the model is constructed. For Horovod this is always zero.
Returns: tuple containing loss tensor as returned from
loss.compute_loss()
and list of outputs tensors, which is taken fromdecoder.decode()['outputs']
. Whenmode == 'infer'
, loss will be None.Return type: tuple
- input_tensors (dict) –
-
_create_decoder
()[source]¶ This function should return decoder class. Overwrite this function if additional parameters need to be specified for decoder, besides provided in the config.
Returns: instance of a class derived from decoders.decoder.Decoder
.
-
_create_encoder
()[source]¶ This function should return encoder class. Overwrite this function if additional parameters need to be specified for encoder, besides provided in the config.
Returns: instance of a class derived from encoders.encoder.Encoder
.
-
_create_loss
()[source]¶ This function should return loss class. Overwrite this function if additional parameters need to be specified for loss, besides provided in the config.
Returns: instance of a class derived from losses.loss.Loss
.
-
decoder
¶ Model decoder.
-
encoder
¶ Model encoder.
-
static
get_optional_params
()[source]¶ Static method with description of optional parameters.
Returns: Dictionary containing all the parameters that can be included into the params
parameter of the class__init__()
method.Return type: dict
-
static
get_required_params
()[source]¶ Static method with description of required parameters.
Returns: Dictionary containing all the parameters that have to be included into the params
parameter of the class__init__()
method.Return type: dict
-
loss_computator
¶ Model loss computator.
-
speech2text¶
-
class
models.speech2text.
Speech2Text
(params, mode='train', hvd=None)[source]¶ Bases:
models.encoder_decoder.EncoderDecoderModel
-
evaluate
(input_values, output_values)[source]¶ This method can be used in conjunction with
self.finalize_evaluation()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that this function is not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting this function can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for evaluation finalization (e.g. accuracy on current batch, which will then be averaged in finalization method).
Return type: list
- input_values – evaluation of
-
finalize_evaluation
(results_per_batch, training_step=None)[source]¶ This method can be used in conjunction with
self.evaluate()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that these methods are not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting these methods can be a useful way to add it.Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - training_step (int) – current training step. Will only be passed if mode is “train_eval”.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- results_per_batch (list) – aggregation of values returned from all calls
to
-
finalize_inference
(results_per_batch, output_file)[source]¶ This method should be implemented if the model support inference mode. For example for speech-to-text and text-to-text models, this method will log the corresponding input-output pair to the output_file.
Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - output_file (str) – name of the output file that inference results should be saved to.
- results_per_batch (list) – aggregation of values returned from all calls
to
-
infer
(input_values, output_values)[source]¶ This method is analogous to
self.evaluate()
, but used in conjunction withself.finalize_inference()
to perform inference.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for inference finalization (e.g. this method can return final generated sequences for each batch which will then be saved to file in
self.finalize_inference()
method).Return type: list
- input_values – evaluation of
-
maybe_print_logs
(input_values, output_values, training_step)[source]¶ This method can be used to print logs that help to visualize training. For example, you can print sample input sequences and their corresponding predictions. This method will be called every
print_samples_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors. Note that this method is not abstract and does not have to be implemented in derived classes. But if additional printing functionality is required, overwriting this method can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer(0).input_tensors
, that is, input tensors for one batch on the first GPU. - output_values – evaluation of
self.get_output_tensors(0)
, that is, output tensors for one batch on the first GPU. - training_step (int) – Current training step.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- input_values – evaluation of
-
-
models.speech2text.
levenshtein
(a, b)[source]¶ Calculates the Levenshtein distance between a and b. The code was copied from: http://hetland.org/coding/python/levenshtein.py
text2text¶
-
class
models.text2text.
Text2Text
(params, mode='train', hvd=None)[source]¶ Bases:
models.encoder_decoder.EncoderDecoderModel
An example class implementing classical text-to-text model.
-
_get_num_objects_per_step
(worker_id=0)[source]¶ Returns number of source tokens + number of target tokens in batch.
-
evaluate
(input_values, output_values)[source]¶ This method can be used in conjunction with
self.finalize_evaluation()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that this function is not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting this function can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for evaluation finalization (e.g. accuracy on current batch, which will then be averaged in finalization method).
Return type: list
- input_values – evaluation of
-
finalize_evaluation
(results_per_batch, training_step=None)[source]¶ This method can be used in conjunction with
self.evaluate()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that these methods are not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting these methods can be a useful way to add it.Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - training_step (int) – current training step. Will only be passed if mode is “train_eval”.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- results_per_batch (list) – aggregation of values returned from all calls
to
-
finalize_inference
(results_per_batch, output_file)[source]¶ This method should be implemented if the model support inference mode. For example for speech-to-text and text-to-text models, this method will log the corresponding input-output pair to the output_file.
Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - output_file (str) – name of the output file that inference results should be saved to.
- results_per_batch (list) – aggregation of values returned from all calls
to
-
infer
(input_values, output_values)[source]¶ This method is analogous to
self.evaluate()
, but used in conjunction withself.finalize_inference()
to perform inference.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for inference finalization (e.g. this method can return final generated sequences for each batch which will then be saved to file in
self.finalize_inference()
method).Return type: list
- input_values – evaluation of
-
maybe_print_logs
(input_values, output_values, training_step)[source]¶ This method can be used to print logs that help to visualize training. For example, you can print sample input sequences and their corresponding predictions. This method will be called every
print_samples_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors. Note that this method is not abstract and does not have to be implemented in derived classes. But if additional printing functionality is required, overwriting this method can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer(0).input_tensors
, that is, input tensors for one batch on the first GPU. - output_values – evaluation of
self.get_output_tensors(0)
, that is, output tensors for one batch on the first GPU. - training_step (int) – Current training step.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- input_values – evaluation of
-
text2speech¶
-
class
models.text2speech.
Text2Speech
(params, mode='train', hvd=None)[source]¶ Bases:
models.encoder_decoder.EncoderDecoderModel
-
evaluate
(input_values, output_values)[source]¶ This method can be used in conjunction with
self.finalize_evaluation()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that this function is not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting this function can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for evaluation finalization (e.g. accuracy on current batch, which will then be averaged in finalization method).
Return type: list
- input_values – evaluation of
-
finalize_evaluation
(results_per_batch, training_step=None)[source]¶ This method can be used in conjunction with
self.evaluate()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that these methods are not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting these methods can be a useful way to add it.Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - training_step (int) – current training step. Will only be passed if mode is “train_eval”.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- results_per_batch (list) – aggregation of values returned from all calls
to
-
finalize_inference
(results_per_batch, output_file)[source]¶ This method should be implemented if the model support inference mode. For example for speech-to-text and text-to-text models, this method will log the corresponding input-output pair to the output_file.
Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - output_file (str) – name of the output file that inference results should be saved to.
- results_per_batch (list) – aggregation of values returned from all calls
to
-
static
get_required_params
()[source]¶ Static method with description of required parameters.
Returns: Dictionary containing all the parameters that have to be included into the params
parameter of the class__init__()
method.Return type: dict
-
infer
(input_values, output_values)[source]¶ This method is analogous to
self.evaluate()
, but used in conjunction withself.finalize_inference()
to perform inference.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for inference finalization (e.g. this method can return final generated sequences for each batch which will then be saved to file in
self.finalize_inference()
method).Return type: list
- input_values – evaluation of
-
maybe_print_logs
(input_values, output_values, training_step)[source]¶ This method can be used to print logs that help to visualize training. For example, you can print sample input sequences and their corresponding predictions. This method will be called every
print_samples_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors. Note that this method is not abstract and does not have to be implemented in derived classes. But if additional printing functionality is required, overwriting this method can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer(0).input_tensors
, that is, input tensors for one batch on the first GPU. - output_values – evaluation of
self.get_output_tensors(0)
, that is, output tensors for one batch on the first GPU. - training_step (int) – Current training step.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- input_values – evaluation of
-
-
models.text2speech.
griffin_lim
(magnitudes, n_iters=50)[source]¶ Griffin-Lim algorithm to convert magnitude spectrograms to audio signals
-
models.text2speech.
plot_spectrograms
(specs, titles, stop_token_pred, audio_length, logdir, train_step, stop_token_target=None, number=0, append=False, save_to_tensorboard=False)[source]¶ Helper function to create a image to be logged to disk or a tf.Summary to be logged to tensorboard.
Parameters: - specs (array) – array of images to show
- titles (array) – array of titles. Must match lengths of specs array
- stop_token_pred (np.array) – np.array of size [time, 1] containing the stop token predictions from the model.
- audio_length (int) – lenth of the predicted spectrogram
- logdir (str) – dir to save image file is save_to_tensorboard is disabled.
- train_step (int) – current training step
- stop_token_target (np.array) – np.array of size [time, 1] containing the stop token target.
- number (int) – Current sample number (used if evaluating more than 1 sample from a batch)
- append (str) – Optional string to append to file name eg. train, eval, infer
- save_to_tensorboard (bool) – If False, the created image is saved to the logdir as a png file. If True, the function returns a tf.Summary object containing the image and will be logged to the current tensorboard file.
Returns: tf.Summary or None
-
models.text2speech.
save_audio
(magnitudes, logdir, step, mode='train', number=0, save_to_tensorboard=False)[source]¶ Helper function to create a wav file to be logged to disk or a tf.Summary to be logged to tensorboard.
Parameters: - magnitudes (np.array) – np.array of size [time, n_fft/2 + 1] containing the energy spectrogram.
- logdir (str) – dir to save image file is save_to_tensorboard is disabled.
- step (int) – current training step
- number (int) – Current sample number (used if evaluating more than 1 sample
- mode (str) – Optional string to append to file name eg. train, eval, infer from a batch)
- save_to_tensorboard (bool) – If False, the created file is saved to the logdir as a wav file. If True, the function returns a tf.Summary object containing the wav file and will be logged to the current tensorboard file.
Returns: tf.Summary or None
image2label¶
-
class
models.image2label.
Image2Label
(params, mode='train', hvd=None)[source]¶ Bases:
models.encoder_decoder.EncoderDecoderModel
-
_get_num_objects_per_step
(worker_id=0)[source]¶ Returns number of images in current batch, i.e. batch size.
-
evaluate
(input_values, output_values)[source]¶ This method can be used in conjunction with
self.finalize_evaluation()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that this function is not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting this function can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer().input_tensors
concatenated across all workers. That is, input tensors for one batch combined from all GPUs. - output_values – evaluation of
self.get_output_tensors()
concatenated across all workers. That is, output tensors for one batch combined from all GPUs.
Returns: all necessary values for evaluation finalization (e.g. accuracy on current batch, which will then be averaged in finalization method).
Return type: list
- input_values – evaluation of
-
finalize_evaluation
(results_per_batch, training_step=None)[source]¶ This method can be used in conjunction with
self.evaluate()
to calculate evaluation metrics. For example, for speech-to-text models these methods can calculate word-error-rate on the validation data. For text-to-text models, these methods can compute BLEU score. Look at the corresponding derived classes for examples of this. These methods will be called everyeval_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors (using evaluation model). Theself.evaluate()
method is called on each batch data and it’s results will be collected and provided toself.finalize_evaluation()
for finalization. Note that these methods are not abstract and does not have to be implemented in derived classes. But if evaluation functionality is required, overwriting these methods can be a useful way to add it.Parameters: - results_per_batch (list) – aggregation of values returned from all calls
to
self.evaluate()
method (number of calls will be equal to number of evaluation batches). - training_step (int) – current training step. Will only be passed if mode is “train_eval”.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- results_per_batch (list) – aggregation of values returned from all calls
to
-
maybe_print_logs
(input_values, output_values, training_step)[source]¶ This method can be used to print logs that help to visualize training. For example, you can print sample input sequences and their corresponding predictions. This method will be called every
print_samples_steps
(config parameter) iterations and input/output values will be populated automatically by callingsess.run
on corresponding tensors. Note that this method is not abstract and does not have to be implemented in derived classes. But if additional printing functionality is required, overwriting this method can be a useful way to add it.Parameters: - input_values – evaluation of
self.get_data_layer(0).input_tensors
, that is, input tensors for one batch on the first GPU. - output_values – evaluation of
self.get_output_tensors(0)
, that is, output tensors for one batch on the first GPU. - training_step (int) – Current training step.
Returns: dictionary with values that need to be logged to TensorBoard (can be empty).
Return type: dict
- input_values – evaluation of
-