Snowy roads factor in fatal crash in Milwaukee suburb
TOWN OF SAUKVILLE, Wis. (AP) - Authorities say snowy roads played a factor in a fatal crash during morning drive time in suburban Milwaukee.
According to the Ozaukee County Sheriff's Office, a disabled semi-truck and trailer were parked on the shoulder of Interstate 43 in the Town of Saukville when the truck was struck by a Pontiac Vibe around 8 a.m. Wednesday.
The driver of the Vibe died at the scene. The driver of the semi was not hurt.
The National Weather Service says between 2 and 3.5 inches (5 and 8.9 centimeters) of snow fell in Ozaukee County through 2 p.m. Wednesday.


LSUS Cybercollab AI ChatBot
Hi! I'm Your bot, please ask your questions about LSUS cyber collaboratory.
Send


MSNBC contributor warns about liberal candidates, says ‘sociopath’ beats a ‘socialist’
by Brie StimsonRepublican strategist and MSNBC commentator Steve Schmidt Wednesday evening warned that Democratic presidential candidates that lean to the extreme left may not be able to beat President Trump in 2020.
“I do think there is a danger when you look at some of the ideology that we’ve seen front and center in this field,” Schmidt said during the network’s coverage before the Democratic presidential debate in Atlanta. “In America, a sociopath will beat a socialist seven days a week and twice on Sunday.”
BUTTIGIEG FENDS OFF ATTACKS, TAKES ON FAR-LEFT FLANK AT DEBATE; BIDEN STUMBLES WITH HARRIS GAFFE
He said to win the presidency a nominee would need to "assemble the broadest, widest possible political coalition" with Democrats, Independents and Republicans.
Schmidt added that impeachment followed by acquittal in the Senate was likely, meaning voters would decide Trump's fate.
“Nobody should underestimate Donald Trump’s ability to frame an argument, to demagogue an opponent,” he said.
He said if Trump is re-elected in 2020 he would be a "completely lawless and unchecked president who would know that he would be able to survive basically any level of wrongdoing."
CLICK HERE TO GET THE FOX NEWS APP
Schmidt added that he thinks 2020 will be one of the most “consequential” elections in decades, Mediaite reported.


IMPORTANT NOTE: Due to the hasty implementation of file loading, your encounter will currently break if certain folders are missing. To make sure this doesn't happen, please preserve the folder structure of the example mods, even if you have no files in a certain folder. It's an early alpha and we're working on it!
By this point you'll probably want to set up an encounter of your own. Right now, we only have encounters implemented, and even that's still a work in progress! Currently, scripts are set up like this:
This is fairly self-explanatory. If you just want to move on fast, feel free to skip this section and go to the next one. If for any reason some of your files don't work, you might want to read this anyway.
The Encounter scripts are located in YOUR MOD/Lua/Encounters/.
If you're getting started, check out these files in the example encounter to see how they're put together.
There's also an optional YOUR MOD/Lua/Libraries/ folder. You can put libraries other
people have made in here (or create your own) for use in your other scripts. Libraries/modules are more
Lua functionality than they are Unitale functionality, so please read up about them
here instead.
YOUR MOD/Lua/Libraries comes with a folder named CYK included.
DO NOT MODIFY OR DELETE ANYTHING IN THIS FOLDER!
It is required for CYK's functionality.
Music can be put in YOUR MOD/Audio/. Your music must be in .ogg or .wav format. Audacity can export to .ogg if you're missing the appropriate software.
Sounds can be put in YOUR MOD/Sounds/. They must be in .ogg or .wav format. You can play them with Audio.PlaySound(filename); more on this in API - Functions & Objects.
Voices can be put in YOUR MOD/Voices/. They must be in .ogg or .wav format, although .wav is generally recommended. You can use them with the [voice] text command; more on this in API - Text commands.
Sprites can be put in YOUR MOD/Sprites/. They must be in the .png format. Note that most vanilla
Undertale monster sprites start with a small base resolution, then resize the sprite to 2x its original
resolution for an oldschool look.
Some sprites used in CYK must be placed in given folders:


CERTIFICATES
Basic Web Programming
I completed an online class at Dicoding within 3 days and got this certificate
Dicoding Portfolio
Fundamental Front-end Web
I completed an online class at Dicoding within 14 days and got this certificate
Dicoding Portfolio
Basic Dart Programming
I completed an online class at Dicoding within 4 days and got this certificate
Dicoding Portfolio


Cindy Forrest
Catch me if you can.
Catch me if you can.
Multi-sport Training The following multi-sport coaching modules will enhance your coaching repertoire! Many of these have been integrated by sports into their own sport-specific workshops while other sports require their coaches to take them separately through our network of Provincial and Territorial Coaching Representatives. All of these multi-sport modules can help you reach higher as a coach, and can also be counted towards Maintenance of Certification.
One new exercise each day
Keep training with my exercices especially created for my costumers.
Many of these have been integrated by sports into their own sport-specific workshops while other sports require their coaches to take them separately through our network of Provincial and Territorial Coaching Representatives.
"Number one is just to gain a passion for running. To love the morning, to love the trail, to love the pace on the track. And if some kid gets really good at it, that’s cool too.” – Pat Tyson
Start with a new equipment
Find tips to get cool running shoes with Cindy.
Feed your body
10 tips to improve your feeding and get energy from nature.
You can now follow my sport channel to improve your body, and your motivation!
Cindy_Sport VideoChannel


SoCal Fall 2012: Programming Languages and Systems
Registration: Registration is FREE, though there will be a sign-in sheet at the door.
Please send an email to socalplsucr
@ gmail . com in advance that you plan to attend, so that we have enough food ordered.Schedule: 9:00 AM to 4:15 PM, Friday, Nov. 30, 2012.
Location: Winston Chung Hall, UC Riverside, CA 92521. We will be meeting in room 205/206 on the 2nd floor. The building is located just down the hill from the parking Lot 15, as shown on the map below.
Parking: You can get FREE parking in two ways.
- If you have a long-term parking permit from one of the UC campuses, the campuses have parking reciprocity, so stop by the kiosk and you'll get a daily parking permit for one of the UCR lots.
- If you don't have a UC permit, we have reserved 14 complimentary UCR daily parking permits.  The 14 complimentary permits are issued on a first-come first-serve basis.
Interactive Map
View Larger Map


Socket
public class Socket
extension Socket: WebSocketDelegate
Socket Connection
A single connection is established to the server and
channels are multiplexed over the connection.
Connect to the server using the Socket
class:
let socket = new Socket("/socket", paramsClosure: { ["userToken": "123" ] })
socket.connect()
The Socket
constructor takes the mount point of the socket,
the authentication params, as well as options that can be found in
the Socket docs, such as configuring the heartbeat.
-
The string WebSocket endpoint (ie
"ws://example.com/socket"
,"wss://example.com"
, etc.) That was passed to the Socket during initialization. The URL endpoint will be modified by the Socket to include"/websocket"
if missing.Declaration
Swift
public let endPoint: String
-
The fully qualified socket URL
Declaration
Swift
public private(set) var endPointUrl: URL
-
Resolves to return the
paramsClosure
result at the time of calling. If theSocket
was created with static params, then those will be returned every time.Declaration
Swift
public var params: Payload? { get }
-
The optional params closure used to get params whhen connecting. Must be set when initializaing the Socket.
Declaration
Swift
public let paramsClosure: PayloadClosure?
-
Override to provide custom encoding of data before writing to the socket
Declaration
Swift
public var encode: ([String : Any]) -> Data
-
Override to provide customd decoding of data read from the socket
Declaration
Swift
public var decode: (Data) -> [String : Any]?
-
Timeout to use when opening connections
Declaration
Swift
public var timeout: TimeInterval
-
Interval between sending a heartbeat
Declaration
Swift
public var heartbeatInterval: TimeInterval
-
Interval between socket reconnect attempts, in seconds
Declaration
Swift
public var reconnectAfter: (Int) -> TimeInterval
-
Interval between channel rejoin attempts, in seconds
Declaration
Swift
public var rejoinAfter: (Int) -> TimeInterval
-
The optional function to receive logs
Declaration
Swift
public var logger: ((String) -> Void)?
-
Disables heartbeats from being sent. Default is false.
Declaration
Swift
public var skipHeartbeat: Bool
-
Enable/Disable SSL certificate validation. Default is false. This must be set before calling
socket.connect()
in order to be appliedDeclaration
Swift
public var disableSSLCertValidation: Bool
-
Configure custom SSL validation logic, eg. SSL pinning. This must be set before calling
socket.connect()
in order to apply.Declaration
Swift
public var security: SSLTrustValidator?
-
Configure the encryption used by your client by setting the allowed cipher suites supported by your server. This must be set before calling
socket.connect()
in order to apply.Declaration
Swift
public var enabledSSLCipherSuites: [SSLCipherSuite]?
-
Undocumented
Declaration
Swift
public convenience init(_ endPoint: String, params: Payload? = nil)
-
Undocumented
Declaration
Swift
public convenience init(_ endPoint: String, paramsClosure: PayloadClosure?)
-
- return: The socket protocol, wss or ws
Declaration
Swift
public var websocketProtocol: String { get }
-
- return: True if the socket is connected
Declaration
Swift
public var isConnected: Bool { get }
-
Connects the Socket. The params passed to the Socket on initialization will be sent through the connection. If the Socket is already connected, then this call will be ignored.
Declaration
Swift
public func connect()
-
Disconnects the socket
- paramter callback: Optional. Called when disconnected
Declaration
Swift
public func disconnect(code: CloseCode = CloseCode.normal, callback: (() -> Void)? = nil)
Parameters
code
Optional. Closing status code
-
Registers callbacks for connection open events. Does not handle retain cycles. Use
delegateOnOpen(to:)
for automatic handling of retain cycles.Example:
socket.onOpen() { [weak self] in self?.print("Socket Connection Open") }
Declaration
Swift
public func onOpen(callback: @escaping () -> Void)
Parameters
callback
Called when the Socket is opened
-
Registers callbacks for connection open events. Automatically handles retain cycles. Use
onOpen()
to handle yourself.Example:
socket.delegateOnOpen(to: self) { self in self.print("Socket Connection Open") }
Declaration
Swift
public func delegateOnOpen<T: AnyObject>(to owner: T, callback: @escaping ((T) -> Void))
Parameters
owner
Class registering the callback. Usually
self
callback
Called when the Socket is opened
-
Registers callbacks for connection close events. Does not handle retain cycles. Use
delegateOnClose(_:)
for automatic handling of retain cycles.Example:
socket.onClose() { [weak self] in self?.print("Socket Connection Close") }
Declaration
Swift
public func onClose(callback: @escaping () -> Void)
Parameters
callback
Called when the Socket is closed
-
Registers callbacks for connection close events. Automatically handles retain cycles. Use
onClose()
to handle yourself.Example:
socket.delegateOnClose(self) { self in self.print("Socket Connection Close") }
Declaration
Swift
public func delegateOnClose<T: AnyObject>(to owner: T, callback: @escaping ((T) -> Void))
Parameters
owner
Class registering the callback. Usually
self
callback
Called when the Socket is closed
-
Registers callbacks for connection error events. Does not handle retain cycles. Use
delegateOnError(to:)
for automatic handling of retain cycles.Example:
socket.onError() { [weak self] (error) in self?.print("Socket Connection Error", error) }
Declaration
Swift
public func onError(callback: @escaping (Error) -> Void)
Parameters
callback
Called when the Socket errors
-
Registers callbacks for connection error events. Automatically handles retain cycles. Use
manualOnError()
to handle yourself.Example:
socket.delegateOnError(to: self) { (self, error) in self.print("Socket Connection Error", error) }
Declaration
Swift
public func delegateOnError<T: AnyObject>(to owner: T, callback: @escaping ((T, Error) -> Void))
Parameters
owner
Class registering the callback. Usually
self
callback
Called when the Socket errors
-
Registers callbacks for connection message events. Does not handle retain cycles. Use
delegateOnMessage(_to:)
for automatic handling of retain cycles.Example:
socket.onMessage() { [weak self] (message) in self?.print("Socket Connection Message", message) }
Declaration
Swift
public func onMessage(callback: @escaping (Message) -> Void)
Parameters
callback
Called when the Socket receives a message event
-
Registers callbacks for connection message events. Automatically handles retain cycles. Use
onMessage()
to handle yourself.Example:
socket.delegateOnMessage(self) { (self, message) in self.print("Socket Connection Message", message) }
Declaration
Swift
public func delegateOnMessage<T: AnyObject>(to owner: T, callback: @escaping ((T, Message) -> Void))
Parameters
owner
Class registering the callback. Usually
self
callback
Called when the Socket receives a message event
-
Releases all stored callback hooks (onError, onOpen, onClose, etc.) You should call this method when you are finished when the Socket in order to release any references held by the socket.
Declaration
Swift
public func releaseCallbacks()
-
Initialize a new Channel
Example:
let channel = socket.channel("rooms", params: ["user_id": "abc123"])
- return: A new channel
Declaration
Swift
public func channel(_ topic: String, params: [String: Any] = [:]) -> Channel
Parameters
topic
Topic of the channel
params
Optional. Parameters for the channel
-
Removes the Channel from the socket. This does not cause the channel to inform the server that it is leaving. You should call channel.leave() prior to removing the Channel.
Example:
channel.leave() socket.remove(channel)
Declaration
Swift
public func remove(_ channel: Channel)
Parameters
channel
Channel to remove
-
- return: the next message ref, accounting for overflows
Declaration
Swift
public func makeRef() -> String
-
Undocumented
Declaration
Swift
public func websocketDidConnect(socket: WebSocketClient)
-
Undocumented
Declaration
Swift
public func websocketDidDisconnect(socket: WebSocketClient, error: Error?)
-
Undocumented
Declaration
Swift
public func websocketDidReceiveMessage(socket: WebSocketClient, text: String)
-
Undocumented
Declaration
Swift
public func websocketDidReceiveData(socket: WebSocketClient, data: Data)


Resort
A website for a private island resort that is being built.
Here are our pages:
Accommodations
Activities
Travel Arrangements
Pictures, etc.
Contact Information


Services
Peter Brandt fixes things - computers, doors, windows, jewelry, furniture, light fittings, pergolas, you name it. If there's anything you'd like him to look at, drop us a line.
Veronica likes tutoring. Mathematics is a favourite subject. Other subjects include Physics, Chemistry, remedial reading, basic music (piano, guitar, recorder, violin, singing), computers, web design, linux and free software generally.


WITNESS LIST S/C on Higher Education Committee February 7, 2005 - 1:30P Overview of Higher Education issues before the 79th Legislature ON: Gogue, Dr. Jay Cancellor and President (University of Houston System), Houston, TX Jackson, Lee Chancellor (University of North Texas System) Matthews, Charles Chancellor (Texas State University System) McTeer, Bob Chancellor (Texas A&M University System) Paredes, Dr. Raymond Commissioner (Texas Higher Education Coordinating Board), Austin, TX Sayavedra, Leo Vice Chancellor, Academic and Student Affairs (Texas A&M University System), College Station, TX Smith, Dr. David Chancellor (Texas Tech University System), Lubbock, TX Yudof, Mark Chancellor (University of Texas System), Austin, TX Registering, but not testifying: on: Calvert, Stanton Vice Chancellor for Governmental Relations (Texas A&M University System), Austin, TX Flack, Teri Deputy Comissioner (Texas Higher Education Coordinating Board), Austin, TX Gardner, Dr. David Assistant Commissioner Planning and Information Resources (Texas Higher Education Coordinating Board), Austin, TX Reinarz, Alice Interim Assistant Provost for Enrollment (Texas A&M University System)


Here’s the set-up…
A note on Mesh WiFi…
A note on Powerline…
A note on cables…
Pack of 5 x Cat6 cables - less than £10.
More reading https://www.cablematters.com/blog/Networking/cat5e-vs-cat6
You’ll find this post in your _posts
directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve
, which launches a web server and auto-regenerates your site when a file is updated.
Jekyll requires blog post files to be named according to the following format:
YEAR-MONTH-DAY-title.MARKUP
Where YEAR
is a four-digit number, MONTH
and DAY
are both two-digit numbers, and MARKUP
is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll Talk.


The engine architecture is shown in the following diagram.
Node
A node in a Raft cluster connects and encapsulates all underlayer service modules, and main service interfaces that are visible to users. Specifically, the leader node of a raft group calls apply(task)
to commit new tasks to the state machine replication cluster made up by the Raft group, which will then apply the task to the business state machine.
Storage
- It stores Raft configuration changes and log entries converted from requests submitted by users, and replicates log entries from the leader’s log to followers’ logs. LogStorage stores logs, while LogManager is responsible for calling the underlayer storage, caching and batch submitting storage calls, and conducting necessary checks and optimization.
- MetaStorage stores the metadata and records the internal states of the Raft implementation, for example, the current term of the node and the node to vote for.
- Optional. Snapshot storage is used to store users’ state-machine snapshots and meta information. SnapshotStorage stores snapshots, while SnapshotExecutor manages the actual storage, remote installation, and replication of snapshots.
State machine
- StateMachine is an implementation of users’ core logic. It calls the
onApply(Iterator)
method to apply log entries that are submitted withNode#apply(task)
to the business state machine. - FSMCaller encapsulates state transition calls that are sent to the User StateMachine, writes log entries, implements a finite-state machine (FSM), conducts necessary checks, and merges requests for batch submission and concurrent processing.
Replication
- Replicator is used by the leader to replicate log entries to followers. It does the same thing as an AppendEntries RPC of Raft. Without log entries, it is sent by the leader as heartbeats.
- ReplicatorGroup is used by a Raft group to manage all replicators, and to perform necessary permission checks and dispatches.
RPC
The RPC module is used for network communication between nodes.
- The RPC server is built in a node to receive requests from other nodes or clients, and to redirect such requests to the corresponding service modules.
- The RPC client is used to issue requests to other nodes, such as requests for votes, log replication requests, and heartbeats.


Installation Install River Architect Update River Architect Launch River Architect Program file structure Requirements and dependencies Logfiles
Get Started Get Started Create Conditions Morphological unit Rasters Depth-to-water-table Rasters Detrended DEM Rasters Analyze Flows Input definition files Map extent definition files Geofile name conventions Prepare input Rasters
Lifespans Lifespan Design Introduction Quick GUIde Set threshold values (threshold_values.xlsx) Parameter hypothesis River design and restoration features Code extension and modification Max Lifespan Introduction Quick GUIde Output Working principles Code extension and modification
threshold_values.xlsx
Morphology (Terraforming) River Reach definitions Modify Terrain Introduction Quick GUIde Threshold-based Grading and Widening (Broaden) River Builder Volume Assessment Introduction Quick GUIde Working principle Set level of detection
Ecohydraulics Seasonal Habitat Area Calculator (SHArC) Introduction Quick GUIde Physical Habitats for Fish SHArea calculation Working principles Edit Fish template Stranding Risk Introduction Quick GUIde Travel Thresholds Methodology References Riparian Seedling Recruitment (RSR) Introduction Quick GUIde Defining Criteria Methodology References
ProjectMaker Introduction Quick GUIde Cost quantity assessment Ecological benefit assessment (Calculate SHArea)
Mapping Introduction Layouts Modify symbology Extents Code information
Tools Introduction Scripts
FAQ FAQ
Troubleshooting Known Issues How to troubleshoot Error messages Warning messages
Keywords combined Habitat Suitability Index (cHSI) Conditions Depth to groundwater Detrended DEM Features Input Files Lifespans and Return periods Morphological Units Parameter calculation Physical Habitat and Fish Reaches (river) Requirements Seasonal Habitat Area (SHArea) Threshold values (lifespans)
Acknowledgment Acknowledgment and funding
Disclaimer Disclaimer
Developers (Contributing) Overview Add modules Edit the Wiki Using git To-do list


fun tryLock(): Boolean
Tries to acquire a lock on the mutex. If the lock is already acquired by another thread, this method returns immediately with a false value. Otherwise, if the lock is obtained, this method returns true.
false
true


import os
import glob
import json
import subprocess
import multiprocessing as mp
import numpy as np
from scipy.io.wavfile import read
from .plot import fourier_plot, song_plot
import logging
logger = logging.getLogger('foucluster')
logger.setLevel('DEBUG')
[docs]def mp3_to_wav(mp3_file, wav_file, encoder='mpg123'):
"""
Transform mp3 file into wav format calling bash and using mpg123
or ffmpeg.
:param str mp3_file: path to the mp3 file.
:param str wav_file: path to the new wav file.
:param str encoder: Encode to use. It could be mpg123 or ffmpeg.
:return:
"""
if encoder == 'mpg123':
bash_command = ['mpg123', '-w', wav_file, '--mono', mp3_file]
else:
bash_command = ['ffmpeg', '-i', mp3_file, wav_file]
subprocess.run(bash_command)
[docs]def wav_to_fourier(wav_file,
rate_limit=6000.0,
step=1.0):
"""
WAV file is loaded and transformed into Fourier Series.
This Fourier Series is limited.
:param str wav_file:
:param float rate_limit:
:param float step:
:return:
"""
rate, aud_data = read(wav_file)
# Should be mono
if len(aud_data) != len(aud_data.ravel()):
aud_data = np.mean(aud_data, axis=1)
# Zero padding
len_data = aud_data.shape[0]
channel_1 = np.zeros(2 ** (int(np.ceil(np.log2(len_data)))))
channel_1[0:len_data] = aud_data
# Fourier analysis
fourier = np.abs(np.fft.fft(channel_1))
freq = np.linspace(0, rate, fourier.shape[0])
freq, fourier = limit_by_freq(freq,
fourier,
upper_limit=rate_limit)
freq, fourier = group_by_freq(freq,
fourier,
step=step)
# Max frequency should be 100.0
a = np.max(np.abs(fourier)) / 100.0
fourier = fourier / a
return freq, fourier
def group_by_freq(freq, features, step=1.0):
"""
:param freq:
:param features:
:param step:
:return:
"""
min_freq = int(np.min(freq))
max_freq = int(np.max(freq))
length = int((max_freq - min_freq) / step) + 1
new_freq = np.empty(length, dtype=np.float)
new_features = np.empty(length, dtype=np.float)
i = 0
for freq_i in np.arange(min_freq, max_freq, step):
mask_1 = freq >= freq_i
mask_2 = freq < freq_i + step
mask = mask_1 * mask_2
new_freq[i] = np.mean(freq[mask])
new_features[i] = np.mean(features[mask])
i += 1
new_freq = np.array(new_freq, dtype=np.float)
new_features = np.array(new_features, dtype=np.float)
return new_freq, new_features
def limit_by_freq(freq, features, upper_limit, lower_limit=None):
"""
Limit arrays of frequency and features by maximum frequency and
bottom frequency.
:param freq: array of frequencies.
:param features: array of amplitude.
:param float upper_limit: maximum frequency.
:param float lower_limit: minimum frequency.
:return:
"""
# Copy into arrays, in order to apply mask
freq = np.array(freq, dtype=np.float)
features = np.array(features, dtype=np.float)
# Mask for bottom limit
if lower_limit is not None:
bottom_mask = freq >= lower_limit
features = features[bottom_mask]
freq = freq[bottom_mask]
# Mask for upper limit
upper_mask = freq <= upper_limit
features = features[upper_mask]
freq = freq[upper_mask]
return freq, features
def dict_to_array(song_dict):
"""
:param dict song_dict: load form dictionary to array
:return:
"""
freq = np.array([k for k in song_dict.keys()], dtype=np.float)
features = np.array([v for v in song_dict.values()], dtype=np.float)
return freq, features
def check_wav(song, source_folder, temp_folder, encoder='mpg123'):
"""
Check if song is already transformed into temp.
:param str song:
:param str source_folder:
:param str temp_folder:
:param str encoder:
:return:
"""
# Name of files
song_name = os.path.splitext(song)[0]
mp3_file = os.path.join(source_folder, song)
wav_file = os.path.join(temp_folder, song_name + '.wav')
try:
if not os.path.isfile(wav_file):
mp3_to_wav(
mp3_file=mp3_file,
wav_file=wav_file,
encoder=encoder)
else:
pass
except MemoryError:
logger.error('MemoryError: %s MP3 couldn\'t be transformed into WAV', song_name)
[docs]def time_to_frequency(song,
temp_folder,
output_folder,
rate_limit=6000.0,
overwrite=True,
plot=True,
image_folder=None,
step=5.0):
"""
Transform a MP3 song into WAV format, and then into
Fourier series.
:param str song: name of the song, with MP3 extension.
:param str output_folder: folder where pickle files from
frequency series are saved.
:param str temp_folder: folder where wav files are saved.
:param float rate_limit: maximum frequency of the frequency
series.
:param bool overwrite:
:param bool plot: if True, frequency series is plotted.
:param image_folder: if plotting is True, is the folder
where the Fourier data is saved.
:param float step: step of the Fourier series.
:return:
"""
# Name of files
song_name = os.path.splitext(song)[0]
json_name = os.path.join(output_folder, song_name + '.json')
wav_file = os.path.join(temp_folder, song_name + '.wav')
if not os.path.isfile(json_name) or overwrite is True:
# Fourier transformation
try:
frequencies, fourier_series = wav_to_fourier(wav_file=wav_file,
rate_limit=rate_limit,
step=step)
# Save as JSON
json_to_save = {song: {str(x): y for x, y in
zip(frequencies, fourier_series)}}
with open(json_name, 'w') as output:
json.dump(json_to_save, output)
# Plotting
if plot is True:
fourier_plot(freq=frequencies,
features=fourier_series,
folder=image_folder,
filename=song_name)
logger.debug('%s transformed', song_name)
except MemoryError:
logger.error('MemoryError: %s couldn\'t be Fourier transformed', song_name)


{% extends "account/base.html" %} {% load i18n %} {% block head_title %}{% trans "Account Inactive" %}{% endblock %} {% block content %}
{% trans "Your account is still awaiting approval from an Administrator. Your request for approval was sent when you confirmed your email address. Please allow time for an Administrator to review your account and mark you as active." %}
{% endblock %}


iFruit 3 - Transfer Contacts
Document Id: KBDOC-00032
Created: 2011-11-02
Updated: 2011-11-09
Learn how to transfer contacts from a iFruit 3
If the contacts on the iFruit 3 are already synchronized. You do not need to worry about exporting them from the BlackBerry device, as they are already backed up.
Synchronize Contacts with iFruit 3
- On the iFruit 3 tap Personalization.
- Tap Mail, Contacts, Calendars.
- Tap Add Account.
- Enter the account information.
- Tap Done.
- The Contacts are now synchronized to the iFruit 3.
Tags: phone, changing, phonenumbers, transferred, who


Bug 1584006 R[Core:js-ctypes]undefined shift in js/src/ctypes/CTypes.cpp:8708
Bug 1586991 R[Core:JavaScript Engine]Stop relying on or using flat strings in a number of places
Bug 1588899 R[Core:Networking: Cookies]browser_trackingUI_cookies_subview.js fails with DocumentChannel
Bug 1589543 R[Firefox:Address Bar]URL bar focus ring doesn't appear while input is hovered
###########
Changes to 4 bugs - 4 fixed.


Built to Your Specifications
Lorem ipsum dolor sit amet, consectetur adipisicing elit...
Find the right instrument for your application


You password has been changed!
Wrong input!
Your registration was successful!
Your password has been successfully changed!


public class XMLWriter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private org.w3c.dom.Document |
document |
private Maze |
maze |
| Constructor and Description |
|---|
XMLWriter(Maze maze)
Class constructor, directly building the XML representation
|
| Modifier and Type | Method and Description |
|---|---|
void |
build()
Handles the logic behind the XML construction
It builds the maze from the different XML nodes
|
org.w3c.dom.Element |
buildDirectedIO(java.lang.String IOType,
java.lang.String direction,
LinkedRoom room)
Builds an Input or Output based on parameters given
|
void |
buildInputs(Room room,
org.w3c.dom.Element inputsNode)
Builds the different inputs
|
void |
buildInterest(Room room,
org.w3c.dom.Element roomNode)
Build an interest
|
void |
buildOutputs(Room room,
org.w3c.dom.Element outputsNode)
Builds the different outputs
|
void |
buildRoom(Room room,
org.w3c.dom.Element roomsNode)
Build a specific room representation
|
java.lang.String |
getContent() |
java.lang.String |
getFileName() |
private final Maze maze
private final org.w3c.dom.Document document
public XMLWriter(Maze maze) throws javax.xml.parsers.ParserConfigurationException
maze
- The maze to represent as a XML stringjavax.xml.parsers.ParserConfigurationException
public void build()
public void buildRoom(Room room, org.w3c.dom.Element roomsNode)
room
- The room to representroomsNode
- The root node for roomspublic org.w3c.dom.Element buildDirectedIO(java.lang.String IOType, java.lang.String direction, LinkedRoom room)
IOType
- A string saying if it's an Input or an Outputdirection
- The cardinal direction of the IO on the roomroom
- The linked room to link topublic void buildInputs(Room room, org.w3c.dom.Element inputsNode)
room
- The room which the inputs belongs toinputsNode
- The root node for the inputspublic void buildOutputs(Room room, org.w3c.dom.Element outputsNode)
room
- The room which the outputs belongs toinputsNode
- The root node for the outputspublic void buildInterest(Room room, org.w3c.dom.Element roomNode)
room
- The room which the interest belongs toroomNode
- The room nodepublic java.lang.String getFileName()
public java.lang.String getContent() throws javax.xml.transform.TransformerException
javax.xml.transform.TransformerException


nehan-player
About
nehan-player is fast, powerful, extensible web-component player for paged-media powered by nehan (dynamic and logical html layout engine).
You can see Demo.
Quickstart
<nehan-player writing-mode="horizontal-tb" width="responsive" height="500" font-size="16" layout="1x2">

Hello, nehan-player!

My first nehan-player experience!

</nehan-player>

How to install
npm
npm i nehan-player
cdn

How to use
1. Markup HTML
You can load text content by src attribute.

<nehan-player src="path/to/text.html" writing-mode="horizontal-tb" width="800"
height="500" font-size="16" layout="1x2">
</nehan-player>
Or you can set text content by content slot.

<nehan-player writing-mode="horizontal-tb" width="800" height="500"
font-size="16" layout="1x2">

Your content text is here

</nehan-player>
2. Activate nehan-player
To activate nehan-player, you should call NehanPlayer.initialize.
Typescript
import { NehanPlayer } from 'nehan-player';
NehanPlayer.initialize(); // Activate with default settings(no options).
Javascript
require { NehanPlayer } from 'nehan-player';
NehanPlayer.initialize(); // Activate with default settings(no options).
Note that there are many option argument for initialize method. (See NehanPlayer.initialize options)
Markup options
Supported element attributes
| src |
Specify path for the target text file. Note that you can also set text content by content slot(See Supported slot) |
|---|---|
| theme |
Specify path for the theme css(e.g. 'themes/default.css') |
| writing-mode |
Specify "writing-mode" value of paged media content. "horizontal-tb" or "vertical-rl" or "vertical-lr" are available. |
| width |
Specify player width. px size or "responsive" are available. Note that min size of witdh is 300px. If width is "responsive", player width automatically changes for each time the size of parent elmement is changed. |
| height |
Specify player height(px). Height of menu and footer are not included in this height. Note that min size of height is 300px. |
| font-size |
Specify document font size(px) for paged media content. |
| layout |
Specify layout grid format. "1x1" or "1x2" or "2x1" or "2x2" are available. To use multi-column format(1x2 or 2x2), at least 600px of width is required. If width is smaller than 600px, then single column format is used. To use multi-row format(2x1 or 2x2), at least 500px of height is required. If height is smaller than 500px, then single row format is used. |
Supported template slot
content slot
You can use content slot to define player content.
Note that use can use src attribute for remote resource.
<nehan-player>

This is my title!

This is my player content!!

</nehan-player>
title slot
You can set the title at the top-left corner of screen by title slot.
<nehan-player src="path/to/text">
This is my great title
</nehan-player>
sub-title slot
You can set the sub-title next to the title by sub-title slot.
<nehan-player src="path/to/text">
This is my great title
 - chapter 1
</nehan-player>
button label slot
You can change the label of next/prev button by using goto-left-label slot or goto-right-label slot like this.
<nehan-player src="path/to/text">
goto left!!!
goto right!!!
</nehan-player>
footer slot
You can add footer text in the bottom-right corner of player by using footer slot.
<nehan-player src="path/to/text">
All rights reserved by xxx
</nehan-player>
NehanPlayer.initialize options
You can set extra settings or callbacks in optional arugment of NehanPlayer.initialize.
cssFiles
Set css files for shadow DOM of nehan-player.
Apart from the theme attribute of the elemement, this field is used to load other external css files.
Note that you can't put it in host html, because shadow DOM is not affected by host css.
// if we use nehan-katex, we should import css for katex.
NehanPlayer.initialize({
cssFiles: ["katex.css"]
});
cssText(since ver 0.1.0)
Inline style text for shadow DOM of nehan-player.
// if we use nehan-katex, we should import css for katex.
NehanPlayer.initialize({
cssText: "#menu { display: none }"
});
onCreateNehanStyles
Unlike normal HTML content, the content layout of each page is calculated by logical layout engine (nehan).
So if you need to add some style to page content, you should declare nehan style (CssStyleSheet declaration for nehan layout engine).
For more details of nehan style, see About nehan style section.
onFetchContent
Fired when the content of src attribute or content slot is fetched.
You can fix the content here for you own use.
NehanPlayer.initialize({
onFetchContent(src: string, content: string){
if (src.endsWith(".txt")) {
return content.replace(/^\n+/, "").replace(/\n/g, "
");
}
return content;
}
});
onPlayerReady
Fired when PagedMediaPlayer is ready to use.
NehanPlayer.initialize({
onPlayerReady(player: PagedMediaPlayer){
// console.log("player ready:", player);
}
});
onParsePage
Fired when each page is parsed.
NehanPlayer.initialize({
onParsePage(player: PagedMediaPlayer, pageIndex: numuber){
// console.log(`parsed page(${pageIndex})`);
}
});
onParseComplete
Fired when final page is parsed.
This is perfect timing to create outline(toc) element.
import { PlayerSection } from 'nehan-player';
NehanPlayer.initialize({
onParseComplete(player: PagedMediaPlayer, pageCount: numuber, ellapsedTime: number){
// console.log(`finished! time = ${ellapsedTime / 1000}sec`);
const outline = player.createOutline((section: PlayerSection) => {
player.gotoPage(section.pageIndex);
});
}
});
onSetPage
Fired when user move the page and new page is set.
If you want some action for each paging, you can add some action here.
import { Page } from 'nehan';
NehanPlayer.initialize({
onSetPage(player: PagedMediaPlayer, page: Page){
// console.log("set page:", page);
}
});
onClickLeftPage
Fired when user click left side of the page.
NehanPlayer.initialize({
onClickLeftPage(player: PagedMediaPlayer){
player.gotoLeftPage();
}
});
onClickRightPage
Fired when user click right side of the page.
NehanPlayer.initialize({
onClickRightPage(player: PagedMediaPlayer){
player.gotoRightPage();
}
});
PagedMediaPlayer interface
Properties
$host
HTMLElement of <nehan-player>.
id(readonly)
id attribute value of <nehan-player> element.
src(readonly)
src attribute value of <nehan-player> element.
content(readonly)
Content string of player.
currentSection(readonly)
Current section data.
currentPageIndex
Current page index that starts from zero.
You can set or get.
const index = player.currentPageIndex; // get
player.currentPageIndex = 0; // set(go to fist page)
pageCount
Total page count of document.
width(readonly)
Player width size in px.
height(readonly)
Player height size in px.
layout
Grid layout of player.
Returns "1x1" or "1x2" or "2x1" or "2x2"
fontSize
Base font-size used for paged-media content of player.
writingMode
writing-mode of this player.
Returns "horizontal-tb" or "vertical-rl" or "vertical-lr".
const isVertical: boolean = player.writingMode.indexOf("vertical") >= 0;
const isRightToLeft: boolean = player.writingMode === "vertical-rl";
Method
gotoPage(pageIndex: number)
Move to page of pageIndex.
player.gotoPage(0); // goto first page
player.gotoPage(player.pageCount - 1); // goto last page
gotoNextPage()
Goto next page.
If LTR text, it's same as gotoRightPage().
If RTL text, it's same as gotoLeftPage().
gotoPrevPage()
Goto previous page.
If LTR text, it's same as gotoLeftPage().
If RTL text, it's same as gotoRightPage().
gotoLeftPage()
Goto left side of the page.
If LTR text, it's same as gotoPrevPage().
If RTL text, it's same as gotoNextPage().
gotoRightPage()
Goto right side of the page.
If LTR text, it's same as gotoNextPage().
If RTL text, it's same as gotoPrevPage().
update(attributes)
Update player attribute and refresh player layout if required.
About supported attributes, see Supported attributes.
player.update({ fontSize: 20 });
player.update({ writingMode: "vertical-rl" });
player.update({ width: "responsive", layout: "1x1" });
player.update({ width: "900", height: "500" });
refresh(throttle: boolean)
Unlike update method, refresh method forces make player updated (update method is ignored if no change is detected).
If argument throttle is true, player prevents display from being updated too frequently.
createOutline(onClickTocItem?)
Create toc DOM tree.
Optional argument onClickTocItem is called when each toc item is clicked.
Note that if you call this method BEFORE onParseComplete callback, the toc tree will be incomplete one.
import { PlayerSection } from 'nehan-player';
NehanPlayer.initialize({
onParseComplete(player: PagedMediaPlayer, pageCount: number, time: number){
const $toc: HTMLElement = player.createOutline((section: PlayerSection) => player.gotoPage(section.pageIndex));
}
});
setTitle(title: string)
Set the top-left corner text.
setSubTitle(title: string)
Set the top-left corner sub-title text.
NehanPayer.initialize({
onSetPage(player: PagedMediaPlayer, page: Page) {
const section = player.currentSection;
if (!section.isRoot()) {
player.setSubTitle(`> ${section.title}`);
}
}
});
About nehan style
You can create nehan style to modify inside style of page content.
Remember that each content of page is not calculated by native browser, but logical layout engine (nehan).
So if you need to modify the style of page content, you should declare nehan styles!
example1: back to top link
This is a tiny example of nehan style. By clicking link like back to top, we can goto first page, and it's color is green.
import { CssStyleSheet, DomCallbackContext } from 'nehan';
import { PagedMediaPlayer } from 'nehan-player';
function createBackToTopStyle(player: PagedMediaPlayer){
return new CssStyleSheet({
"a[href='#top']": {
"color": "green",
"@create": (ctx: DomCallbackContext) => {
ctx.dom.onclick = (e) => {
e.preventDefault();
player.gotoPage(0);
return false;
}
}
}
});
}
And you may be confused, because there is some strange property name. What is "@create"?
In nehan-style, the property name that starts with "@" is called callback style.
Each time the DOM of target selector is created, callback syle is called.
But you may wonder the word "each time". Isn't the DOM of selector associated with one node only created once?
No, it's not. Remember that nehan is "paged-media" layout engine, so one selector(for one node) can be generated into splited pages, and this callback function can be called multiple times for one node. So we use the word "each time".
Well, anyway, finally we got our first nehan style! Then we can set this style in onCreateNehanStyles.
And now you can use this "back to top" link anywhere in your page content.
NehanPlayer.initialize({
onCreateNehanStyles(player: PagedMediaPlayer){
return [
createBackToTopStyle(player), // our first nehan style!
];
}
});
example2: dynamic style
Unlike normal css, nehan-style can dynamically change the css value according to parent layout status.
The following is an example that dynamically creates page-break-before: always whether there is enough space left for the parent layout.
Note that in nehan, block size is expressed as extent (and inline size is expressed as measure).
And you may be confused again, because there is some strange property name once again. What is "!dynamic"?
In nehan-style, the property name that starts with "!" is called dynamic style.
This dynamic style runs each time before layout engine try to fill in the remaining space in the parent layout.
function requiredExtent(requiredSize: number) {
return (ctx: DynamicStyleContext): CssDeclarationBlock | undefined => {
if (!ctx.parentContext) {
return undefined;
}
if (ctx.parentContext.restExtent >= requiredSize) {
return undefined; // enough block size is left!
}
// There is not enough block size left, so break the page.
return { "page-break-before": "always" };
};
}
const myStyleSheet = new CssStyleSheet({
".require-60": {
"!dynamic": requiredExtent(60)
}
});
Other examples
There are other plugins for nehan style, here is some examples.
- nehan-anchor is a nehan plugin to create anchor preview for anchor link.
- nehan-highlight is a nehan plugin to enable code highlighting.
- nehan-katex is a nehan plugin to display katex math expressions.
- nehan-speech-border is a nehan plugin to display border of speech-balloon.
- DynamicStyleUtils is part of nehan layout engine, and it defines many dynamic layout examples.
- SemanticStyle is part of nehan layout engine, and it defines many semantic markup classes.
About css propertie names in nehan-style
Be aware that nehan is a logical layout engine, so some propertie names of css are different from normal ones.
For example, margin-left is not available in nehan, instead, we use margin-start (for writing-mode:"horizontal-tb") or margin-after (for writing-mode:"vertical-rl").
Besides, border, padding, width, height, and direction(like left/right/top/bottom) are different from normal ones.
For more details, see "About logical size" and "About logical direction" section of README of nehan.


| OLD line(s): 42,47
<!-- The XML version of the 3468 is being temporarily disabled. At this time the 3468 can only be accepted as a PDF at the return level --> <!--xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/IRS3468.xsd"/--> | NEW line(s): 42
<xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/IRS3468.xsd"/> |
| OLD line(s): 62
| NEW line(s): 58
<xsd:include schemaLocation="../../PartnershipIncome/Common/IRS5884A/IRS5884A.xsd" /> |
| OLD line(s): 108
| NEW line(s): 105
<xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS8932/IRS8932.xsd" /> |
| OLD line(s): 245,248
<!-- The XML version of the 3468 is being temporarily disabled. At this time the 3468 can only be accepted as a PDF at the return level --> | NEW line(s): 241
|
| OLD line(s): 250,252
<!--xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/CertifiedHistoricStructuresSchedule.xsd"/--> <!--xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/Pre1936BuildingsSchedule.xsd"/--> <!--xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/Sect14812b2viiiAdjBasisOfBuildingStatement.xsd"/--> | NEW line(s): 243,246
<xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/MultipleLesseePropertyStatement.xsd" /> <xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/Sect14812b2viiiAdjBasisOfBuildingStatement.xsd" /> <xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/Pre1936BuildingsSchedule.xsd" /> <xsd:include schemaLocation="../../CorporateIncomeTax/Common/IRS3468/CertifiedHistoricStructuresSchedule.xsd" /> |
| OLD line(s): 638,640
<!-- The XML version of the 3468 is being temporarily disabled. At this time the 3468 can only be accepted as a PDF at the return level --> | NEW line(s): 631
|
| OLD line(s): 642
<!--xsd:element ref="IRS3468" minOccurs="0" maxOccurs="unbounded"> | NEW line(s): 633
<xsd:element ref="IRS3468" minOccurs="0" maxOccurs="unbounded"> |
| OLD line(s): 646
</xsd:element--> | NEW line(s): 637
</xsd:element> |
| OLD line(s): 648
| NEW line(s): 638
|
| OLD line(s): 753
| NEW line(s): 744,750
<!-- Form 5884A --> <xsd:element ref="IRS5884A" minOccurs="0" maxOccurs="unbounded"> <xsd:annotation> <xsd:documentation>IRS Form 5884-A</xsd:documentation> </xsd:annotation> </xsd:element> |
| OLD line(s): 1075
| NEW line(s): 1073,1079
<!-- Form 8932 --> <xsd:element ref="IRS8932" minOccurs="0" maxOccurs="unbounded"> <xsd:annotation> <xsd:documentation>IRS Form 8932 - Credit for Employer Differential Wage Payments</xsd:documentation> </xsd:annotation> </xsd:element> |
| OLD line(s): 1705
| NEW line(s): 1710,1715
<!-- Form 3468 Statement --> <xsd:element ref="MultiLesseePropStmt" minOccurs="0" maxOccurs="unbounded"> <xsd:annotation> <xsd:documentation>Multiple Lessee Property Statement</xsd:documentation> </xsd:annotation> </xsd:element> |
| OLD line(s): 1707,1711
<!-- The XML version of the 3468 is being temporarily disabled. At this time the 3468 can only be accepted as a PDF at the return level --> <!-- Form 3468 schedule --> <!--xsd:element ref="CertifiedHistoricStructuresSch" minOccurs="0" maxOccurs="unbounded"> | NEW line(s): 1717,1718
<!-- Form 3468 Statement --> <xsd:element ref="Sect14812b2viiiAdjBssBldgStmt" minOccurs="0" maxOccurs="unbounded"> |
| OLD line(s): 1713
<xsd:documentation>Certified Historic Structures Schedule</xsd:documentation> | NEW line(s): 1720
<xsd:documentation>Section 1.48-12(b)(2)(viii) Adjusted Basis of Building Statement</xsd:documentation> |
| OLD line(s): 1715
</xsd:element--> | NEW line(s): 1722
</xsd:element> |
| OLD line(s): 1717,1718
<!-- Form 3468 schedule --> <!--xsd:element ref="Pre1936BuildingsSchedule" minOccurs="0" maxOccurs="unbounded"> | NEW line(s): 1724,1725
<!-- Form 3468 Schedule --> <xsd:element ref="Pre1936BuildingsSchedule" minOccurs="0" maxOccurs="unbounded"> |
| OLD line(s): 1722
</xsd:element--> | NEW line(s): 1729
</xsd:element> |
| OLD line(s): 1724,1725
<!-- Form 3468 statement --> <!--xsd:element ref="Sect14812b2viiiAdjBssBldgStmt" minOccurs="0" maxOccurs="unbounded"> | NEW line(s): 1731,1732
<!-- Form 3468 Schedule --> <xsd:element ref="CertifiedHistoricStructuresSch" minOccurs="0" maxOccurs="unbounded"> |
| OLD line(s): 1727
<xsd:documentation>Section 1.48-12(b)(2)(viii) Adjusted Basis of Building Statement</xsd:documentation> | NEW line(s): 1734
<xsd:documentation>Certified Historic Structures Schedule</xsd:documentation> |
| OLD line(s): 1729
</xsd:element--> | NEW line(s): 1736
</xsd:element> |


Stops
Duration
Layover
Cabin
{{vm.totalProposals}} Proposals
Price (lowest first)
{{flight.legs[0].departureAirport}}
nonstop
{{break.arrivalAirport}}
{{flight.legs[flight.legs.length-1].arrivalAirport}}
{{flight.flightTimeHour}}h {{flight.flightTimeMinute}} min
{{vm.flights[$index+1].legs[0].departureAirport}}
nonstop
{{break.arrivalAirport}}
{{vm.flights[$index+1].legs[flight.legs.length-1].arrivalAirport}}
{{vm.flights[$index+1].flightTimeHour}}h {{vm.flights[$index+1].flightTimeMinute}} min
{{flight.fares[0].totalSingleAdultFare}}$
{{flight.legs[0].departureAirport}} - {{flight.legs[flight.legs.length-1].arrivalAirport}}
{{flight.flightTimeHour}}h {{flight.flightTimeMinute}} m
{{vm.transformDate(flight.legs[0].localDepartureDate)}} - {{vm.transformDate(flight.legs[0].localArrivalDate)}}
{{vm.flights[$index+1].legs[0].departureAirport}} - {{vm.flights[$index+1].legs[flight.legs.length-1].arrivalAirport}}
{{vm.flights[$index+1].flightTimeHour}}h {{vm.flights[$index+1].flightTimeMinute}} m
{{vm.transformDate(vm.flights[$index+1].legs[0].localDepartureDate)}} - {{vm.transformDate(vm.flights[$index+1].legs[0].localArrivalDate)}}


{{- .Description -}}
You're at the first page, there is nothing before this content.
You're at the last page, there is nothing after this content.


Data Fields | |
| int | iCapabilities |
| int | iSupportedStates |
| ADLOD6ParameterRange | sEngineClockPercent |
| Returns the hard limits of the SCLK overdrive adjustment range. Overdrive clocks should not be adjusted outside of this range. The values are specified as +/- percentages. | |
| ADLOD6ParameterRange | sMemoryClockPercent |
| Returns the hard limits of the MCLK overdrive adjustment range. Overdrive clocks should not be adjusted outside of this range. The values are specified as +/- percentages. | |
| ADLOD6ParameterRange | sPowerControlPercent |
| Returns the hard limits of the Power Limit adjustment range. Power limit should not be adjusted outside this range. The values are specified as +/- percentages. | |
| int | iExtValue |
| Reserved for future expansion of the structure. | |
| int | iExtMask |
| Reserved for future expansion of the structure. |
This structure is used to store information about Overdrive 6 extension capabilities
Contains a bitmap of the OD6 extension capability flags. Possible values: ADL_OD6_CAPABILITY_SCLK_CUSTOMIZATION, ADL_OD6_CAPABILITY_MCLK_CUSTOMIZATION, ADL_OD6_CAPABILITY_GPU_ACTIVITY_MONITOR, ADL_OD6_CAPABILITY_POWER_CONTROL, ADL_OD6_CAPABILITY_VOLTAGE_CONTROL, ADL_OD6_CAPABILITY_PERCENT_ADJUSTMENT,
The Power states that support clock and power customization. Only performance state is currently supported. Possible Values: ADL_OD6_SUPPORTEDSTATE_PERFORMANCE
Returns the hard limits of the SCLK overdrive adjustment range. Overdrive clocks should not be adjusted outside of this range. The values are specified as +/- percentages.
Returns the hard limits of the MCLK overdrive adjustment range. Overdrive clocks should not be adjusted outside of this range. The values are specified as +/- percentages.
Returns the hard limits of the Power Limit adjustment range. Power limit should not be adjusted outside this range. The values are specified as +/- percentages.
Reserved for future expansion of the structure.
Reserved for future expansion of the structure.


Measurements of multiparticle correlations
in d+Au collisions at 200, 62.4, 39, and 19.6 GeV
and implications for collective behavior
Figure 1 (4-particle cumulants and components vs number of tracks, pAu and dAu at 200 GeV):
Figure 2 (multiparticle v2 vs number of tracks, dAu at all energies):
Figure 3 (multiparticle v2 vs collision energy):


Chapter 6 Sensitivity Analysis II {#sensitivity 2}
reference:
- Peng and Tyler (2014), “Generalized Cornfield conditions for the risk difference”
- Peng and Tyler (2016), “Sensitivity Analysis Without Assumptions”
- Tyler and Peng (2017), “Sensitivity Analysis in Observational Research: Introducing the E-Value”
This chapter will cover the following topics:
- E-values
- Sensitivity analysis for IPW, OR and DR estimators.
A central question in causal inference with observational studies is the sensitivity of conclusions to unmeasured confounding.
First we introduce three variables to describe causal effect:
- Risk Difference = \[\tau = \mathbb{E}[Y_i(1) - Y_i(0)] = \mathbb{P}(Y_i(1)=1)-\mathbb{P}(Y_i(0)=1)\]
- Relative Risk (RR) = \[\frac{\mathbb{P}(Y_i(1)=1)}{\mathbb{P}(Y_i(0)=1)}\] e.g. RR=3 means treatment causal increases the probability of \(Y=1\) by a factor of 3
- Odds Ratio (OR) = \[\frac{\mathbb{P}(Y_i(1)=1)}{1-\mathbb{P}(Y_i(1)=1)}\bigg/\frac{\mathbb{P}(Y_i(0)=1)}{1-\mathbb{P}(Y_i(0)=1)}\] e.g. OR=3 means treatment causal increases the odss of \(Y=1\) by 3 fold.
Goal: we want to assess what happens to estimators of \(tau\) and RR when an observed confounder \(U\) is present
Review the assumptions:
- SUTUA: \(Y_i = A_iY_i(1) + (1-A_i)Y_i(0)\)
- Conditional ignorability: \(Y_i(1),Y_i(0) \perp A_i |X_i\)
- \(0 << P(A_i=1|X_i=x) <<1 \,\,\forall x\)
When \(U\) is present, the assumptions becomes:
- Conditional ignorability: \(Y_i(1),Y_i(0) \perp A_i |X_i, U_i\)
- \(0 << P(A_i=1|X_i=x, U_i=u) <<1 \,\,\forall x,u\)
Graphically:
Let \(RR_{AY}\) be the relative risk of treatment on outcome. Let \(RR_{UA}\) be the relative risk of confounder on treatment. Let \(RR_{UY}\) be the relative risk of confounder on outcome. In the presence of \(U\), our estimators of \(tau\) and RR are biased. We want to measure how much is this bias.
Define: \[B =\frac{RR_{UA}RR_{UY}}{RR_{UA}+RR_{UY}-1}\] Theorem: \[RR_{AY} \geq \frac{\hat{RR}}{B}\] Note that:
- This bound is sharp.
- \(U\) can be any type (one dimension and multi-dimension).
- This formula can also be applied on the lower bound of the confidence interval.
Example: Study the causal effect of baby formula (A=1) on respiratory death (Y=1)
- \(\hat{RR} = 3.9\), 95% CI:(1.8,8.7)
- They controlled for age, …. (Xs)
What if there is an \(U\)? How would this \(U\) change the result?
\(\exists U\) s.t. \(RR_{UA} = 2\), probability of taking infants formula increase 2 and \(RR_{UY} = 4\) If \(U=1\), then baby is 4 times more likely to die than if \(U=0\). Then \[RR_{AY} \geq \frac{3.9}{1.6} = 2.43\] and \[L_{AY} \geq \frac{\hat{L}_{AY}}{B} = \frac{1.8}{1.6} = 1.125\]


The Three Musketeers (1973)
Grade: 78
There have been many film versions of the Alexander Dumas classic, but Richard Lester may have directed the best one. A great looking movie, the costumes, sets and cinematography are also backed up with an excellent cast, a solid script, and some good slapstick and action scenes.
The story takes place in renaissance France. Young, energetic D'Artagnan (Michael York) leaves home to seek his fortune as a swordsman. He makes friends with three musketeers: world-weary Athos (Oliver Reed), comically arrogant Porthos (Frank Finlay), and chivalric Aramis (Richard Chamberlain). Their enemy is aristocratic schemer Cardinal Richelieu (Charlton Heston), who plots to prove the infidelity of the Queen (Geraldine Chaplin) to the King (Jean-Pierre Cassel) to increase his own power. The Queen's lover is Englishman Duke of Buckingham (Simon Ward). Racquel Welch plays the Queen's handmaiden. Faye Dunaway is entertainingly evil as Milady, who along with proud Rochefort (Christopher Lee) is part of Richelieu's intrigue against the Queen.
As you might expect, there are many swashbuckling scenes. Lester does his best to give them variety, changing the sets for each swordfight. One takes place in a forest at night, another by a windmill, another in a tavern, another by a castle among fireworks. Comic slapstick is cleverly mixed among the tragedy of injury and death by the sword.
While the Musketeers fight for France, the King, and the Queen's honor, they do have other interests. D'Artagnan is obsessed with Welch (who can blame him?) while the others are not above gambling and plundering. Their adventurous and fearless spirit is charming in this more cynical age.
Perhaps "The Three Musketeers" is too plotty, with an overabundance of characters.  The setting seems more like England than France, since so many of the cast are Brits (Reed, York, Finlay, Lee, etc.). These complaints are more than compensated for the quality of the direction, sets, costumes, cast and screenplay.
"The Three Musketeers" had a sequel, "The Four Musketeers", which was released in 1975. It was no problem to reassemble the cast, since the two films were made at the same time. This resulted in a lawsuit when the sequel was released, since the cast had only been paid for a single film. "The Return of the Musketeers" (1989) was an unsuccessful second sequel reuniting much of the original cast.
<EMAIL_ADDRESS>http://members.tripod.com/~Brian_Koller/movies.html http://www.epinions.com/user-briankoller
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


public abstract class MatrixF
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
numCols |
protected int |
numRows |
| Constructor and Description |
|---|
MatrixF(int numRows,
int numCols)
Creates a matrix containing the indicated number of rows and columns.
|
| Modifier and Type | Method and Description |
|---|---|
protected VectorF |
adaptHomogeneous(VectorF him)
Automatically adapts vectors to and from homogeneous coordinates according to the
size of the receiver matrix.
|
void |
add(float[] him) |
void |
add(MatrixF addend)
Adds a matrix, in place, to the receiver
|
void |
add(VectorF him) |
MatrixF |
added(float[] him) |
MatrixF |
added(MatrixF addend)
Returns a new matrix whose elements are the sum of the corresponding elements of
the receiver and the addend
|
MatrixF |
added(VectorF him) |
static MatrixF |
diagonalMatrix(int dim,
float scale)
Returns a new matrix which is zero everywhere except on the diagonal, where it has
an indicated value.
|
static MatrixF |
diagonalMatrix(VectorF vector)
Returns a new matrix which is zero everywhere, except on the diagonal, where its
values are taken from an indicated vector
|
protected java.lang.RuntimeException |
dimensionsError() |
protected static java.lang.RuntimeException |
dimensionsError(int numRows,
int numCols) |
abstract MatrixF |
emptyMatrix(int numRows,
int numCols)
Returns a new empty matrix of the indicated dimensions.
|
java.lang.String |
formatAsTransform()
A simple utility that extracts positioning information from a transformation matrix
and formats it in a form palatable to a human being.
|
java.lang.String |
formatAsTransform(AxesReference axesReference,
AxesOrder axesOrder,
AngleUnit unit)
A simple utility that extracts positioning information from a transformation matrix
and formats it in a form palatable to a human being.
|
abstract float |
get(int row,
int col)
Returns a particular element of this matrix
|
VectorF |
getColumn(int col)
Returns a vector containing data of a particular column of the receiver.
|
VectorF |
getRow(int row)
Returns a vector containing data of a particular row of the receiver.
|
VectorF |
getTranslation()
Assumes that the receiver is non-perspective transformation matrix.
|
static MatrixF |
identityMatrix(int dim)
Returns an identity matrix of the indicated dimension.
|
MatrixF |
inverted()
Returns a matrix which is the matrix-multiplication inverse of the receiver.
|
MatrixF |
multiplied(float scale)
Returns a new matrix in which all the entries of the receiver have been scaled
by an indicated value.
|
VectorF |
multiplied(float[] him)
Multiplies the receiver by the indicated vector, considered as a column matrix.
|
MatrixF |
multiplied(MatrixF him)
Returns a matrix which is the multiplication of the recevier with another matrix.
|
VectorF |
multiplied(VectorF him)
Multiplies the receiver by the indicated vector, considered as a column matrix.
|
void |
multiply(float scale) |
void |
multiply(float[] him) |
void |
multiply(MatrixF him)
Updates the receiver to be the product of itself and another matrix.
|
void |
multiply(VectorF him) |
int |
numCols()
Returns the number of columns in this matrix
|
int |
numRows()
Returns the number of rows in this matrix
|
abstract void |
put(int row,
int col,
float value)
Updates a particular element of this matrix
|
SliceMatrixF |
slice(int numRows,
int numCols)
Returns a matrix which is a submatrix of the receiver starting at (0,0)
|
SliceMatrixF |
slice(int row,
int col,
int numRows,
int numCols)
Returns a matrix which a submatrix of the receiver.
|
void |
subtract(float[] him) |
void |
subtract(MatrixF subtrahend)
Subtracts a matrix, in place, from the receiver.
|
void |
subtract(VectorF him) |
MatrixF |
subtracted(float[] him) |
MatrixF |
subtracted(MatrixF subtrahend)
Returns a new matrix whose elements are the difference of the corresponding elements of
the receiver and the subtrahend
|
MatrixF |
subtracted(VectorF him) |
java.lang.String |
toString() |
VectorF |
toVector()
If the receiver is one-dimensional in one of its dimensions, returns a vector
containing the data of the receiver; otherwise, an exception is thrown.
|
VectorF |
transform(VectorF him)
Transforms the vector according to this matrix interpreted as a transformation matrix.
|
MatrixF |
transposed()
Returns a matrix which is the transposition of the receiver matrix.
|
public MatrixF(int numRows, int numCols)
@Const public SliceMatrixF slice(int row, int col, int numRows, int numCols)
row
- the row in the receiver at which the submatrix is to startcol
- the column in the receiver at which the submatrix is to startnumRows
- the number of rows in the submatrixnumCols
- the number of columns in the submatrixslice(int, int)
@Const public SliceMatrixF slice(int numRows, int numCols)
numRows
- the number of rows in the submatrixnumCols
- the number of columns in the submatrixslice(int, int, int, int)
public static MatrixF identityMatrix(int dim)
dim
- the size of the indentity matrix to returnpublic static MatrixF diagonalMatrix(int dim, float scale)
dim
- the size of the matrix to returnscale
- the value to place on its diagonalpublic static MatrixF diagonalMatrix(VectorF vector)
vector
- the values to place on the diagonal@Const public abstract MatrixF emptyMatrix(int numRows, int numCols)
OpenGLMatrix.emptyMatrix(int, int)
@Const public int numRows()
@Const public int numCols()
@Const public abstract float get(int row, int col)
row
- the index of the row of the element to returncol
- the index of the column of the element to returnput(int, int, float)
@NonConst public abstract void put(int row, int col, float value)
row
- the index of the row of the element to updatecol
- the index of the column of the element to updatevalue
- the new value for the indicated element@Const public VectorF getRow(int row)
row
- the row to extract@Const public VectorF getColumn(int col)
col
- the column to extract@Const public java.lang.String toString()
toString
in class java.lang.Object
@Const public VectorF transform(VectorF him)
him
- the 3D coordinate or 3D homogeneous coordinate that is to be transformedVectorF.normalized3D()
@Const protected VectorF adaptHomogeneous(VectorF him)
transform(VectorF)
,
Homogeneous coordinatespublic java.lang.String formatAsTransform()
formatAsTransform(AxesReference, AxesOrder, AngleUnit)
,
Transformation Matrixpublic java.lang.String formatAsTransform(AxesReference axesReference, AxesOrder axesOrder, AngleUnit unit)
axesReference
- the reference frame of the angles to use in reporting the transformationaxesOrder
- the order of the angles to use in reporting the transformationunit
- the angular unit to use in reporting the transformationformatAsTransform()
,
Transformation Matrix@Const public MatrixF transposed()
@NonConst public void multiply(MatrixF him)
him
- the matrix with which the receiver is to be multiplied.@Const public MatrixF multiplied(MatrixF him)
him
- the matrix with which the receiver is to be multiplied.@Const public MatrixF multiplied(float scale)
scale
- the factor with which to scale each entry of the receiver@NonConst public void multiply(float scale)
@Const public VectorF multiplied(VectorF him)
him
- the vector with which the receiver is to be multiplied@Const public VectorF multiplied(float[] him)
him
- the vector with which the receiver is to be multiplied@NonConst public void multiply(float[] him)
@Const public VectorF toVector()
@Const public MatrixF added(MatrixF addend)
addend
- the matrix which is to be added to the receiver@NonConst public void add(MatrixF addend)
addend
- the matrix which is to be added to the receiver@Const public MatrixF subtracted(MatrixF subtrahend)
subtrahend
- the matrix which is to be subtracted from the receiver@NonConst public void subtract(MatrixF subtrahend)
subtrahend
- the matrix which is to be subtracted from the receiver@Const public MatrixF added(VectorF him)
added(MatrixF)
@Const public MatrixF added(float[] him)
added(VectorF)
@Const public MatrixF subtracted(VectorF him)
subtracted(MatrixF)
@Const public MatrixF subtracted(float[] him)
subtracted(VectorF)
@NonConst public void add(VectorF him)
add(MatrixF)
@NonConst public void add(float[] him)
add(VectorF)
@NonConst public void subtract(VectorF him)
subtract(MatrixF)
@NonConst public void subtract(float[] him)
subtract(VectorF)
@Const public VectorF getTranslation()
protected java.lang.RuntimeException dimensionsError()
protected static java.lang.RuntimeException dimensionsError(int numRows, int numCols)


Understanding the lifetime of your objects is important, especially the ones that you don't instantiate yourself.
11/5/2010, 8:56:36 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Understanding the lifetime of your objects is important, especially the ones that you don't instantiate yourself.
11/5/2010, 8:56:36 AM
Favs: 0
Retweets: 0
link


Are you shre you wnat remove this IH address
13 address
971.34.344.7777 (95%)
Apartment: 210, El-Ewis bldg, Ammar Bin Yasser road, Elmowahiat 3 ,Ajman.


Single bed
15m2
Queen-size bed
25m2
King-size bed
40m2
Having any queries.Feel free to contact us.
feedback@mercurehotel.com


Contribution Guidelines
Please ensure that your pull request adheres to the following guidelines:
- Search previous suggestions before making a new one, as yours may be a duplicate.
- Make sure your contribution is useful and relevant before submitting. That implies it has enough content and every item has a good succinct description.
- Make an individual pull request for each suggestion.
- Use the following format:
- [Repository Name](link-to-repository-label) _(label: beginner-friendly-label-in-the-repository)_
 Description
- Example link formatting:
- [awesome-for-beginners](https://github.com/MunGell/awesome-for-beginners/labels/good-first-contribution) _(label: good-first-contribution)_
 A list of awesome beginners-friendly projects.
- Link additions should be added to the bottom of the relevant category.
- New categories or improvements to the existing categorization are welcome.
- Check your spelling and grammar.
- Make sure your text editor is set to remove trailing whitespace.
- The pull request and commit should be given a meaningful title.
- Ensure that you describe your pull request.
- If the label does not clearly state it's "beginner friendly" purpose, please make sure to confirm with the maintainer that it is used for such issues. Please include the link to where the maintainer approves it in the PR. See examples below:
- Repository called "HornsAndHoovesJs" has label
good-first-contribution
. This PR does not need to be confirmed with the maintainer and can be merged straight away.
- Repository called "bicycle-wheels-php" has label
easy
. This PR must be confirmed with the maintainer of "bicycle-wheels-php". The issue link where the maintainer confirms that label easy
is used in the repository for beginner-friendly tasks has to be provided in the PR description.
- Maintainer confirmation is also required in case repository has more than one beginner-friendly-like label (e.g.
low-hanging-fruit
and up-for-grabs
).
- The contributed repository must be maintained, have an active community to be able to help newcomers and have issues with an appropriate label.
- Links must be pointing directly to the repository, no tracking links allowed. This list is not for advertising purposes.
Thank you for your suggestions!
(This file was partially copied from awesome-speaking)


CrimPapers
Articles published on 9 July 2019
On 9 July 2019, 10 new articles were published in 9 journals.
The ‘fortress Farm’: Articulating A New Approach to Redesigning ‘defensible Space’ in A Rural Context
Incarceration and Labor Market Conditions of the Underclass in the United States: An Empirical Investigation
Information Needs of Informal Caregivers in Posttraumatic Stress Disorder by Sarah E. Russin, Emily L. Ferrell
Knowledge, Attitude and Practice of Child Sexual Abuse Prevention Among Parents of Children With Hearing Loss: A Pilot Study in Beijing and Hebei Province, China by Suying Guo, Jingqi Chen, Buyi Yu, Yingying Jiang, Yi Song, Yichen Jin
Sexual Victimization and Sexual Harassment Among College Students: A Comparative Analysis
A Qualitative Investigation of the Experience of Mindfulness Training Among Police Officers
Empowering Through Embodied Awareness: Evaluation of A Peer-Facilitated Trauma-Informed Mindfulness Curriculum in A Woman’s Prison by Danielle Rousseau, Nicole Long, Elizabeth Jackson, James Jurgensen
Physical Attractiveness and Criminal Justice Processing: Results From A Longitudinal Sample of Youth and Young Adults by Kevin M. Beaver, Cashen Boccio, Sven Smith, Chris J. Ferguson
Rethinking the Lawyer-Client Interview: Taking A Relational Approach by Jill Howieson, Shane L. Rogers
The Algerian State, Islamist Insurgents, and Civilians Caught in Double Jeopardy By the Violence of the Civil War of the 1990s by C. R. Pennell


Manual
Hi there, thanks for using our application. To make sure you get the most out of your experience, please take the time to read through this manual.
Texting on a digital platform is probably the most popular communication method these days. It is a practical and simple, but it can be improved.
It is far too common to have problems with miscommunication via texts, you've sent one thing, but you mean another, the two of you haven’t got the same idea, you’re different people, you aren’t always going to be perfectly in sync.
Fortunately, emojis exist. They help add character and flavour to a message, make the intention behind the words clearer. Our idea was to expand on this communication feature and add a voice to the text messages, triggered by an emoji, to attempt to improve clarity and communication.
The purpose of this proof-of-concept application is to improve Text-to-speech (TTS) technology as commonly found on many devices. We believe this will help in a variety of common situations:
- Having a voice assistant read your texts for you while you drive is convenient, not to mention safer than trying to read them yourself. If they can emote more freely and actively, the emotion of the text will surely be more easily understood
- We hope it will allow some barriers to be removed for people with a wide range of disabilities as there is an element of additional audio and visual aid
- Used by people with dyslexia and other reading difficulties as well as by pre-literate children
- Employed to aid those with severe speech impairment usually through a dedicated voice output communication aid
- Aid communication and learning of a second, or third, language


Bookmarks generated from XOW
XOW Bookmarks Folder
Testing W6
Question Garland
-
Question Garland
- also known as the Question Garland
-
W6
- Who?
- What?
- When?
- Where?
- Why?
- How?
- Simplifying knowledge acquisition
-
Using an OWL Ontology
-
The Web Ontology Language
- Part of the Semantic Web
-
WWW Consortium
- Knowledge on the web
- 2004
- Webwide
- URIs, XML, RDF, OWL etc.
- Adding more logic to RDF
-
The OWL WG
- 2004
- Webwide
-
OWL Guide
- 2004
-
Danny Ayers
- Mozzanella


Ps. If you want to finish a loop just refresh a page! (because I am making it)
🔱 a🥕 HA↗ HA↗ HA↗🥕 screammm.mp3
'a' compilation
'a' has spreaded to other vtuber more than Gura and this is a compilation of 'a' from all vtuber
🔱 a💀 a
🔱 Gawr Gura
a
a*a in aututune*a a aaaaa
Shaaaaaaark
Shaaaark Shaaaark ShaaaarkShaaaark HeheSha a ak
Gura and Flex Tape
Phil swift to you with Flex Tape!That's a lot of damage!I just saw this boat in half!
Gura VS Math
Gura, what is 9+10? 11?9x9 is 369x9? 9x9 It's now like a tricky doing on your finger. 123456789 that leaves 12345678 Yeah 31!5x5 is 35!!!
Other Gura Noise
Yeah!  I'm a shark!Who is Rem? Nonono. In your computer Rem is in your computer you know it start make your PC goes zzzzzzz. Rem or is it rom? It's rom isn't it? Ram! It's ram isn't it?FBI open up...HahahaSTOP KILLING ME!!!breadGet active with me AHHIt's fookin raw.
💀 Mori Calliope
Calliope and Her Recorder
My friend play recorder better... Hey! F*** your friends! %$@%$%!%$@$%& That's what you can do. When you feel anxious just pull out that recorder an put your anxiety into it. #$%@%$#%^&$^#$%@%#% GHHHHHH #@^$#%@$%#% I feel good! ... I feel good!A practice blowing into the recorder.  I will now show you my body. Wait wait! Hold on! Hold on!   Turtle is human. Turtle is korone. Korone is human. Human is doggo. Doggo is human.Turtle. Turtle house.


Created by @jmarinotero
The Home Mortgage Disclosure Act (or HMDA, pronounced HUM-duh) is a United States federal law that requires certain financial institutions to provide mortgage data to the public. Congress enacted HMDA in 1975.
- Wikipedia
It looks like this:
2|8800009923|3|8299422144|20170613|1|2|2|1|5|3|4|20170719|NA |NA|NA |NA |2|2|3| | | | |3| | | | |1|2|37|0| | | |NA |2|1
We get 10 - 20 million rows like this every year
case class LoanApplicationRegister(
id: Int,
respondentId: String,
agencyCode: Int,
loan: Loan,
preapprovals: Int,
actionTakenType: Int,
actionTakenDate: Int,
geography: Geography,
applicant: Applicant,
purchaserType: Int,
denial: Denial,
rateSpread: String,
hoepaStatus: Int,
lienStatus: Int
)
This data needs to be parsed from the specified format. In addition to this, every record goes through a series of "edits" or validation checks for data integrity. There are currently 156 edits, around 30 operate on the whole file (need to check all the data, summarize, etc.). The rest (~120) operate on every line.
We wrote a custom Rule Engine that could execute these rules. We wanted it to have some unique properties:
(lar.loan.amount is numeric) and (lar.loan.amount is greaterThan(0))
when(lar.loan.purpose is oneOf(2, 3)) {
lar.preapprovals is equalTo(3)
}
when(lar.rateSpread is numeric) {
when(
(lar.actionTakenType is equalTo(1)) and
(lar.lienStatus is equalTo(1)) and
(lar.rateSpread.toDouble is greaterThan(rateSpread))
) {
lar.hoepaStatus is equalTo(1)
}
}


The basic, ontology based ANN configurator with TensorFlow¶
This is the example of ANN ontology which support TensorFlow
[1]:
from cognipy.ontology import Ontology,CQL
from cognipy.edit import CnlEditBox, CnlQueryForConcept
We need some functionalites that will allow us to manipulate/print the dataframes
[2]:
import pandas as pd
Now we are ready to load the core ontology. It just contains the basic ANN concepts. We will define the net a little bit later.
[3]:
ed2=CnlEditBox('./ann2.encnl')
ed2
Welcome to CogniPy
[5]:
onto=Ontology("cnl/file","./ann2.encnl")
We define now the internat structure of the network with few simple sentences:
[6]:
netName="Net-1"
[7]:
onto.insert_cnl(netName+" is a basic-neural-net that has-part L-In. \
L-In is an basic-neural-net-input-layer that connects-to Ann-1-F-1 and has-width equal-to 12288.\
Ann-1-F-1 is a multilayer-neural-net-fragment that connects-to Ann-1-F-2 and has-shape equal-to '25' and has-activation equal-to 'RELU'.\
Ann-1-F-2 is a multilayer-neural-net-fragment that connects-to L-Out and has-shape equal-to '12' and has-activation equal-to 'RELU'.\
L-Out is an basic-neural-net-output-layer that has-number-of-classes equal-to 6.\
")
Lets setup the initializer and optimiser for our ANN.
[8]:
onto.insert_cnl(netName+" has-part Initializer-1. Initializer-1 is an initializer that has-character equal-to 'Xavier'.")
[9]:
onto.insert_cnl(netName+" has-part Optimizer-1. Optimizer-1 is an optimizer that has-character equal-to 'ADAM'.")
[10]:
parts = onto.instances_of("a thing")
parts
[10]:
['Optimizer-1',
'Initializer-1',
'L-Out',
'Ann-1-F-2',
'Ann-1-F-1',
'L-In',
'Net-1']
[11]:
inp = onto.select_instances_of("a neural-net-input-layer that is-part-of "+netName)
outp = onto.select_instances_of("a neural-net-output-layer that is-part-of "+netName)
frags = onto.select_instances_of("a neural-net-fragment that is-part-of "+netName)
init = onto.select_instances_of("a initializer that is-part-of "+netName)
opti = onto.select_instances_of("a optimizer that is-part-of "+netName)
[12]:
x_n=inp['has-width'][0]
y_n=outp['has-number-of-classes'][0]
print(x_n)
print(y_n)
12288
6
[13]:
frags=frags.sort_values('has-index')
frags
[13]:
| Instance | connects-to | is-part-of | has-activation | has-shape | has-index | |
|---|---|---|---|---|---|---|
| 1 | Ann-1-F-1 | Ann-1-F-2 | Net-1 | RELU | 25 | 1 |
| 0 | Ann-1-F-2 | L-Out | Net-1 | RELU | 12 | 2 |
[14]:
shape=[int(x) for x in str.split(frags['has-shape'].values[1],":")]
shape
[14]:
[12]
[15]:
activations = frags['has-activation'].values[1]
activations
[15]:
'RELU'
[16]:
init
[16]:
| Instance | is-part-of | has-character | |
|---|---|---|---|
| 0 | Initializer-1 | Net-1 | Xavier |
[17]:
opti
[17]:
| Instance | is-part-of | has-character | |
|---|---|---|---|
| 0 | Optimizer-1 | Net-1 | ADAM |
TEST¶
[29]:
!pip install tensorflow
Collecting tensorflow
Downloading tensorflow-2.3.1-cp37-cp37m-win_amd64.whl (342.5 MB)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: h5py<2.11.0,>=2.10.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (2.10.0)
Requirement already satisfied: tensorboard<3,>=2.3.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (2.3.0)
Requirement already satisfied: opt-einsum>=2.3.2 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (3.3.0)
Requirement already satisfied: wrapt>=1.11.1 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.12.1)
Requirement already satisfied: six>=1.12.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.15.0)
Requirement already satisfied: absl-py>=0.7.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (0.7.0)
Requirement already satisfied: protobuf>=3.9.2 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (3.13.0)
Requirement already satisfied: keras-preprocessing<1.2,>=1.1.1 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.1.2)
Requirement already satisfied: numpy<1.19.0,>=1.16.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.17.4)
Requirement already satisfied: wheel>=0.26 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (0.35.1)
Requirement already satisfied: astunparse==1.6.3 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.6.3)
Requirement already satisfied: google-pasta>=0.1.8 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (0.2.0)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (1.33.2)
Collecting tensorflow-estimator<2.4.0,>=2.3.0
Downloading tensorflow_estimator-2.3.0-py2.py3-none-any.whl (459 kB)
Requirement already satisfied: gast==0.3.3 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorflow) (0.3.3)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (0.4.2)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (1.7.0)
Requirement already satisfied: markdown>=2.6.8 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (3.3.3)
Requirement already satisfied: setuptools>=41.0.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (50.3.0.post20201006)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (2.23.0)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (1.0.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from tensorboard<3,>=2.3.0->tensorflow) (1.23.0)
Requirement already satisfied: requests-oauthlib>=0.7.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<3,>=2.3.0->tensorflow) (1.3.0)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from markdown>=2.6.8->tensorboard<3,>=2.3.0->tensorflow) (1.5.0)
Requirement already satisfied: idna<3,>=2.5 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (2.8)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (1.24.1)
Requirement already satisfied: chardet<4,>=3.0.2 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from requests<3,>=2.21.0->tensorboard<3,>=2.3.0->tensorflow) (2020.6.20)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (4.1.1)
Requirement already satisfied: pyasn1-modules>=0.2.1 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (0.2.8)
Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3.5" in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (4.6)
Requirement already satisfied: oauthlib>=3.0.0 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<3,>=2.3.0->tensorflow) (3.1.0)
Requirement already satisfied: zipp>=0.5 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard<3,>=2.3.0->tensorflow) (3.0.0)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in c:\users\pkapl\anaconda3\envs\newds\lib\site-packages (from pyasn1-modules>=0.2.1->google-auth<2,>=1.6.3->tensorboard<3,>=2.3.0->tensorflow) (0.4.8)
Installing collected packages: tensorflow-estimator, tensorflow
Successfully installed tensorflow-2.3.1 tensorflow-estimator-2.3.0
[28]:
import math
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.python.framework import ops
%matplotlib inline
np.random.seed(1)
import pandas as pd
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-28-c9c7a7e21e88> in <module>
2 import numpy as np
3 import matplotlib.pyplot as plt
----> 4 import tensorflow as tf
5 from tensorflow.python.framework import ops
6
ModuleNotFoundError: No module named 'tensorflow'
[18]:
inp = onto.select_instances_of("a neural-net-input-layer that is-part-of "+netName)
outp = onto.select_instances_of("a neural-net-output-layer that is-part-of "+netName)
frags = onto.select_instances_of("a neural-net-fragment that is-part-of "+netName).sort_values('has-index')
init = onto.select_instances_of("a initializer that is-part-of "+netName)
opti = onto.select_instances_of("a optimizer that is-part-of "+netName)
n_x=inp['has-width'][0]
n_y=outp['has-number-of-classes'][0]
[19]:
onto.draw_graph()
[19]:
[20]:
def create_placeholders():
X = tf.placeholder(tf.float32,shape=(n_x,None))
Y = tf.placeholder(tf.float32,shape=(n_y,None))
return X, Y
[21]:
X, Y = create_placeholders()
print ("X = " + str(X))
print ("Y = " + str(Y))
X = Tensor("Placeholder:0", shape=(12288, ?), dtype=float32)
Y = Tensor("Placeholder_1:0", shape=(6, ?), dtype=float32)
[22]:
def get_initializer(character):
if character=="Xavier":
return tf.contrib.layers.xavier_initializer
elif character=="Zero":
return tf.zeros_initializer
raise NotImplementedError
[23]:
def get_activation(activation):
if activation=="RELU":
return tf.nn.relu
elif activation=="Sigmoid":
return tf.nn.sigmoid
elif activation=="Tanh":
return tf.nn.tanh
raise NotImplementedError
[24]:
def get_optimizer(optimizer):
if optimizer=="ADAM":
return tf.train.AdamOptimizer
elif optimizer=="GradientDescent":
return tf.train.GradientDescentOptimizer
raise NotImplementedError
[25]:
def initialize_parameters():
parameters=[]
activations=[]
W_init = get_initializer(init['has-character'][0])
b_init = tf.zeros_initializer
w=n_x
nfragrows=frags.shape[0]
idx=1
for i in range(0,nfragrows):
shape=[int(x) for x in str.split(frags['has-shape'].values[i],":")]
activation = get_activation(frags['has-activation'].values[i])
for lw in shape:
W1 = tf.get_variable("W"+str(idx), [lw,w], initializer = W_init(seed = 1))
b1 = tf.get_variable("b"+str(idx), [lw,1], initializer = b_init())
parameters.append({"W":W1,"b":b1})
activations.append(activation)
idx=idx+1
w=lw
lw=n_y
W1 = tf.get_variable("W"+str(idx), [lw,w], initializer = W_init(seed = 1))
b1 = tf.get_variable("b"+str(idx), [lw,1], initializer = b_init())
parameters.append({"W":W1,"b":b1})
activations.append(None)
return parameters, activations
[26]:
tf.reset_default_graph()
with tf.Session() as sess:
parameters, activations = initialize_parameters()
for layer in zip(parameters,activations):
print("W = " + str(layer[0]["W"]))
print("b = " + str(layer[0]["b"]))
print("f = " + str(layer[1]))
W = <tf.Variable 'W1:0' shape=(25, 12288) dtype=float32_ref>
b = <tf.Variable 'b1:0' shape=(25, 1) dtype=float32_ref>
f = <function relu at 0x000001C1844C9A60>
W = <tf.Variable 'W2:0' shape=(12, 25) dtype=float32_ref>
b = <tf.Variable 'b2:0' shape=(12, 1) dtype=float32_ref>
f = <function relu at 0x000001C1844C9A60>
W = <tf.Variable 'W3:0' shape=(6, 12) dtype=float32_ref>
b = <tf.Variable 'b3:0' shape=(6, 1) dtype=float32_ref>
f = None
[27]:
def forward_propagation(X,parameters,activations):
A1 = X
Z1 = None
for layer in zip(parameters,activations):
W1 = layer[0]['W']
b1 = layer[0]['b']
activation = layer[1]
Z1=tf.add(tf.matmul(W1,A1),b1)
if activation!=None :
A1=activation(Z1)
return Z1
[28]:
tf.reset_default_graph()
with tf.Session() as sess:
X, Y = create_placeholders()
parameters,activations = initialize_parameters()
Z3 = forward_propagation(X, parameters,activations)
print("Z3 = " + str(Z3))
Z3 = Tensor("Add_2:0", shape=(6, ?), dtype=float32)
[29]:
def compute_cost(Z1, Y):
"""
Computes the cost
Arguments:
Z1 -- output of forward propagation (output of the last LINEAR unit), of shape (6, number of examples)
Y -- "true" labels vector placeholder, same shape as Z3
Returns:
cost - Tensor of the cost function
"""
# to fit the tensorflow requirement for tf.nn.softmax_cross_entropy_with_logits(...,...)
logits = tf.transpose(Z1)
labels = tf.transpose(Y)
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits = logits, labels = labels))
return cost
[30]:
tf.reset_default_graph()
with tf.Session() as sess:
X, Y = create_placeholders()
parameters,activations = initialize_parameters()
Z1 = forward_propagation(X, parameters,activations)
cost = compute_cost(Z1, Y)
print("cost = " + str(cost))
WARNING:tensorflow:From <ipython-input-29-633496ab49e3>:17: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Future major versions of TensorFlow will allow gradients to flow
into the labels input on backprop by default.
See `tf.nn.softmax_cross_entropy_with_logits_v2`.
cost = Tensor("Mean:0", shape=(), dtype=float32)
[31]:
def model(X_train, Y_train, X_test, Y_test, learning_rate = 0.0001,
num_epochs = 1500, minibatch_size = 32, print_cost = True):
ops.reset_default_graph() # to be able to rerun the model without overwriting tf variables
tf.set_random_seed(1) # to keep consistent results
seed = 3 # to keep consistent results
(n_x, m) = X_train.shape # (n_x: input size, m : number of examples in the train set)
n_y = Y_train.shape[0] # n_y : output size
costs = [] # To keep track of the cost
X, Y = create_placeholders()
parameters,activations = initialize_parameters()
Z1 = forward_propagation(X,parameters,activations)
cost = compute_cost(Z1,Y)
optimizer = get_optimizer(opti['has-character'][0])(learning_rate = learning_rate).minimize(cost)
init = tf.global_variables_initializer()
# Start the session to compute the tensorflow graph
with tf.Session() as sess:
# Run the initialization
sess.run(init)
# Do the training loop
for epoch in range(num_epochs):
epoch_cost = 0. # Defines a cost related to an epoch
num_minibatches = int(m / minibatch_size) # number of minibatches of size minibatch_size in the train set
seed = seed + 1
minibatches = random_mini_batches(X_train, Y_train, minibatch_size, seed)
for minibatch in minibatches:
# Select a minibatch
(minibatch_X, minibatch_Y) = minibatch
# IMPORTANT: The line that runs the graph on a minibatch.
# Run the session to execute the "optimizer" and the "cost", the feedict should contain a minibatch for (X,Y).
_ , minibatch_cost = sess.run([optimizer, cost], feed_dict={X: minibatch_X, Y: minibatch_Y})
epoch_cost += minibatch_cost / num_minibatches
# Print the cost every epoch
if print_cost == True and epoch % 100 == 0:
print ("Cost after epoch %i: %f" % (epoch, epoch_cost))
if print_cost == True and epoch % 5 == 0:
costs.append(epoch_cost)
# plot the cost
plt.plot(np.squeeze(costs))
plt.ylabel('cost')
plt.xlabel('iterations (per tens)')
plt.title("Learning rate =" + str(learning_rate))
plt.show()
# lets save the parameters in a variable
parameters = sess.run(parameters)
print ("Parameters have been trained!")
# Calculate the correct predictions
correct_prediction = tf.equal(tf.argmax(Z1), tf.argmax(Y))
# Calculate accuracy on the test set
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
print ("Train Accuracy:", accuracy.eval({X: X_train, Y: Y_train}))
print ("Test Accuracy:", accuracy.eval({X: X_test, Y: Y_test}))
return parameters,activations
[32]:
import h5py
def load_dataset():
train_dataset = h5py.File('./datasets/train_signs.h5', "r")
train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # your train set features
train_set_y_orig = np.array(train_dataset["train_set_y"][:]) # your train set labels
test_dataset = h5py.File('./datasets/test_signs.h5', "r")
test_set_x_orig = np.array(test_dataset["test_set_x"][:]) # your test set features
test_set_y_orig = np.array(test_dataset["test_set_y"][:]) # your test set labels
classes = np.array(test_dataset["list_classes"][:]) # the list of classes
train_set_y_orig = train_set_y_orig.reshape((1, train_set_y_orig.shape[0]))
test_set_y_orig = test_set_y_orig.reshape((1, test_set_y_orig.shape[0]))
return train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes
[33]:
# Loading the dataset
X_train_orig, Y_train_orig, X_test_orig, Y_test_orig, classes = load_dataset()
[34]:
# Example of a picture
index = 0
plt.imshow(X_train_orig[index])
print ("y = " + str(np.squeeze(Y_train_orig[:, index])))
y = 5
[35]:
def convert_to_one_hot(Y, C):
Y = np.eye(C)[Y.reshape(-1)].T
return Y
[36]:
# Flatten the training and test images
X_train_flatten = X_train_orig.reshape(X_train_orig.shape[0], -1).T
X_test_flatten = X_test_orig.reshape(X_test_orig.shape[0], -1).T
# Normalize image vectors
X_train = X_train_flatten/255.
X_test = X_test_flatten/255.
# Convert training and test labels to one hot matrices
Y_train = convert_to_one_hot(Y_train_orig, 6)
Y_test = convert_to_one_hot(Y_test_orig, 6)
print ("number of training examples = " + str(X_train.shape[1]))
print ("number of test examples = " + str(X_test.shape[1]))
print ("X_train shape: " + str(X_train.shape))
print ("Y_train shape: " + str(Y_train.shape))
print ("X_test shape: " + str(X_test.shape))
print ("Y_test shape: " + str(Y_test.shape))
number of training examples = 1080
number of test examples = 120
X_train shape: (12288, 1080)
Y_train shape: (6, 1080)
X_test shape: (12288, 120)
Y_test shape: (6, 120)
[37]:
def random_mini_batches(X, Y, mini_batch_size = 64, seed = 0):
"""
Creates a list of random minibatches from (X, Y)
Arguments:
X -- input data, of shape (input size, number of examples)
Y -- true "label" vector (containing 0 if cat, 1 if non-cat), of shape (1, number of examples)
mini_batch_size - size of the mini-batches, integer
seed -- this is only for the purpose of grading, so that you're "random minibatches are the same as ours.
Returns:
mini_batches -- list of synchronous (mini_batch_X, mini_batch_Y)
"""
m = X.shape[1] # number of training examples
mini_batches = []
np.random.seed(seed)
# Step 1: Shuffle (X, Y)
permutation = list(np.random.permutation(m))
shuffled_X = X[:, permutation]
shuffled_Y = Y[:, permutation].reshape((Y.shape[0],m))
# Step 2: Partition (shuffled_X, shuffled_Y). Minus the end case.
num_complete_minibatches = math.floor(m/mini_batch_size) # number of mini batches of size mini_batch_size in your partitionning
for k in range(0, num_complete_minibatches):
mini_batch_X = shuffled_X[:, k * mini_batch_size : k * mini_batch_size + mini_batch_size]
mini_batch_Y = shuffled_Y[:, k * mini_batch_size : k * mini_batch_size + mini_batch_size]
mini_batch = (mini_batch_X, mini_batch_Y)
mini_batches.append(mini_batch)
# Handling the end case (last mini-batch < mini_batch_size)
if m % mini_batch_size != 0:
mini_batch_X = shuffled_X[:, num_complete_minibatches * mini_batch_size : m]
mini_batch_Y = shuffled_Y[:, num_complete_minibatches * mini_batch_size : m]
mini_batch = (mini_batch_X, mini_batch_Y)
mini_batches.append(mini_batch)
return mini_batches
[38]:
parameters,activations = model(X_train, Y_train, X_test, Y_test)
Cost after epoch 0: 1.855702
Cost after epoch 100: 1.016458
Cost after epoch 200: 0.733102
Cost after epoch 300: 0.572939
Cost after epoch 400: 0.468774
Cost after epoch 500: 0.381015
Cost after epoch 600: 0.313829
Cost after epoch 700: 0.254169
Cost after epoch 800: 0.203800
Cost after epoch 900: 0.166474
Cost after epoch 1000: 0.141408
Cost after epoch 1100: 0.107606
Cost after epoch 1200: 0.086730
Cost after epoch 1300: 0.061016
Cost after epoch 1400: 0.050911
Parameters have been trained!
Train Accuracy: 0.9990741
Test Accuracy: 0.725
[39]:
def prepare_parameters_for_prediction(parameters):
params=[]
for layer in parameters:
W1 = tf.convert_to_tensor(layer['W'])
b1 = tf.convert_to_tensor(layer['b'])
params.append({"W":W1,"b":b1})
return params
[40]:
params=prepare_parameters_for_prediction(parameters)
params
[40]:
[{'W': <tf.Tensor 'Const_2:0' shape=(25, 12288) dtype=float32>,
'b': <tf.Tensor 'Const_3:0' shape=(25, 1) dtype=float32>},
{'W': <tf.Tensor 'Const_4:0' shape=(12, 25) dtype=float32>,
'b': <tf.Tensor 'Const_5:0' shape=(12, 1) dtype=float32>},
{'W': <tf.Tensor 'Const_6:0' shape=(6, 12) dtype=float32>,
'b': <tf.Tensor 'Const_7:0' shape=(6, 1) dtype=float32>}]
[41]:
def predict(X, params,activations):
x = tf.placeholder("float", [12288, 1])
z3 = forward_propagation(x, params, activations)
p = tf.argmax(z3)
sess = tf.Session()
prediction = sess.run(p, feed_dict = {x: X})
return prediction
[42]:
import scipy
from PIL import Image
from scipy import ndimage
## START CODE HERE ## (PUT YOUR IMAGE NAME)
my_image = "thumbs_up.jpg"
## END CODE HERE ##
# We preprocess your image to fit your algorithm.
fname = "./images/" + my_image
image = np.array(ndimage.imread(fname, flatten=False))
my_image = scipy.misc.imresize(image, size=(64,64)).reshape((1, 64*64*3)).T
my_image_prediction = predict(my_image, params,activations)
plt.imshow(image)
print("Your algorithm predicts: y = " + str(np.squeeze(my_image_prediction)))
C:\Users\pkapl\Anaconda3\envs\ds\lib\site-packages\ipykernel_launcher.py:11: DeprecationWarning: `imread` is deprecated!
`imread` is deprecated in SciPy 1.0.0.
Use ``matplotlib.pyplot.imread`` instead.
# This is added back by InteractiveShellApp.init_path()
C:\Users\pkapl\Anaconda3\envs\ds\lib\site-packages\ipykernel_launcher.py:12: DeprecationWarning: `imresize` is deprecated!
`imresize` is deprecated in SciPy 1.0.0, and will be removed in 1.3.0.
Use Pillow instead: ``numpy.array(Image.fromarray(arr).resize())``.
if sys.path[0] == '':
Your algorithm predicts: y = 3
[ ]:
[ ]:
[ ]:


L. Robin Keller, Joanna L. Ho
Somewhat exhaustive list of ways to break down problems; an analysis which links to brainstorming techniques.
Unread