{% extends 'base.html' %} {% load static %} {% block menu %}
291 South 21th Street, Suite 721 New York NY 10016
When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then she continued her way.
When she reached the first hills of the Italic Mountains, she had a last view back on the skyline of her hometown Bookmarksgrove, the headline of Alphabet Village and the subline of her own road, the Line Lane. Pityful a rethoric question ran over her cheek, then she continued her way.
Apartment
Far far away, behind the word mountains, far from the countries
250sqft 3 4
Apartment
Far far away, behind the word mountains, far from the countries
250sqft 3 4


Force load a page if an error occurs
Headers to attach to fetch requests done by the PageManager e.g. if you only want to load a partial output containing only the wrapper
Don't do anything if the url has a hash
The maximum amount of pages to have in the cache at any moment in time; PageManager removes pages from the cache to ensure content doesn't become stale; and memory usage isn't too high
Ignore extra clicks of an anchor element if a transition has already started by default PJAX will reload the page on multiple clicks but this allows you to stop extra clicks from affecting the current transition
Specifies which urls to not prefetch It also accepts boolean values:
true
means don't prefetch any anchorfalse
means always prefetch all anchorsThe Prefix attached to data attributes
Attribute used to identify elements that don't want PJAX enabled for themeselves and their child elements
Attribute used to identify anchors that don't want PJAX enabled
Specifies which urls to not use PJAX for
The resize event is debounced by this amount of time (in miliseconds)
On page change (excluding popstate events, and hashes) keep current scroll position
The amount of time in milliseconds to wait before counting the PageManagers fetch requests as timed out
Attribute used to identify transition an anchor wants to use, the value you set will select the transition used by name Note: transition names are case sensitive
TransitionManagers regestered transitions
The attribute used to identify wrappers
Generated using TypeDoc
Specifies which urls to always fetch from the web It also accepts boolean values:
true
means always fetch from the web for all urlsfalse
means always try to fetch from the cachefalse


I write readable, semantic HTML code that follows best practice.
I am proficient in advanced CSS3 styling.
I use Javascript and JQuery to allow for an interactive user experience, as well as for frontend frameworks and API consumption.
I am an advanced Python programmer. I utilise it for many tasks from full-stack web development using the Django framework, to building GUI's both TKinter and PyQt5.
I use SCSS as my principle means to build projects of all sizes.
I am familiar with NodeJS and the ExpressJS framework including API creation, and use Node Package Manager for most of my web development projects.
I competently and frequently use git and the git bash command line as an effective Version Control System and for collaboration.
I am familiar with employing the use of several external UI libraries including Bootstrap, Semantic-UI and TailwindCSS among other CDN's to increase website loading speed in the client's browser.
As one of the most popular Javascript web frameworks available currently, I have in-depth knowledge of the React framework, including hooks, and helped developed a client app using the framework.
Svelte is a unique, reactive Javascript web framework that is incredibly lightweight and incredibly powerful. I often use Svelte and the related Sapper framework, which is built on Svelte, but is still very much in development, for rapid interactive prototyping.
Although I normally use Windows, I also love using Linux and am familiar with multiple distros and enjoy using my Raspberry Pi.
About Me
Having come from a background in academia, where I specialised in Southeast Asian politics, I moved into the realm of programming around the beginning of 2020. Although I did delve for some months into R for quantitative data analysis a few years beforehand, I now find myself as a trainee web developer.
My immediate goals are to boost my knowledge of modern Frontend Web Development to enter into the tech industry, and build upon knowledge of what I already know.
Prior to starting the bootcamp at _Nology in order to attain these goals in early October 2020, I had already taught myself a great deal of Python, eventually teaching myself the Django framework and Django REST Framework for building API's.
I have quite a few other interests outside of the web, including music production and playing with synthesizers.
I love to keep on learning and challenging myself. As a result, I am also fluent in French and at an intermediate-level Mandarin Chinese and Myanmar/Burmese language (both written and spoken)
My Skills
HTML 5
CSS
Javascript
Python
SASS/SCSS
NPM/Node
Git
Bootstrap
React
Svelte
Ubuntu/Linux
How I can help
I have good practical knowledge of building backend and frontend web applications as well as in the creation of RESTful API's.
I can also do a fair bit of computer programming and can build small programmes using Python as well as interact with databases.
I am always prepared for any challenge, big or small. Feel free to browse my portfolio or contact me here.
My LinkedIn and Github profile links are in the footer!


The status bar is displayed on the lower border of the CrypTool window. You can choose whether to display or conceal the status bar by selecting the Status Bar menu option from the menu View.
The left-hand area of the status bar contains text describing:
The right-hand area of the status bar indicates which of the following keys have been pressed:
| Display | Description |
| CAP | The CAPS LOCK key has been activated. |
| NUM | The NUM LOCK key has been activated. |
| SCRL | The SCROLL LOCK key has been activated. |


Solid CSS Buttons – Standard
Solid CSS Buttons – Icon
Solid CSS Buttons Rounded Corners
Solid CSS Buttons – Standard – Hover Effects
Solid CSS Buttons – Icon – Hover Effects
Outline CSS Buttons – Standard
Outline CSS Buttons – Icon
Outline CSS Buttons Rounded Corners
Outline CSS Buttons – Standard – Hover Effects
Outline CSS Buttons – Icon – Hover Effects
Input Type Submit CSS Buttons Examples
- Tag
<input type="submit">
does not support icons.


UPDATE\-CA\-TRUST
Section: update-ca-trust (8)Updated: 10/15/2014
Index Return to Main Contents
NAME
update-ca-trust - manage consolidated and dynamic configuration of CA certificates and associated trustSYNOPSIS
DESCRIPTION
update-ca-trust(8) is used to manage a consolidated and dynamic configuration feature of Certificate Authority (CA) certificates and associated trust.
The feature is available for new applications that read the consolidated configuration files found in the /etc/pki/ca-trust/extracted directory or that load the PKCS#11 module p11-kit-trust.so
This manual page is specific to the series of RHEL 6 releases, which implements this configuration as an optional feature for legacy applications.
Many legacy applications expect CA certificates and trust configuration in a fixed location, contained in files with particular path and name, or by referring to a classic PKCS#11 trust module provided by the NSS cryptographic library.
The dynamic configuration feature can optionally provide functionally compatible replacements for classic configuration files and for the classic NSS trust module named libnssckbi.
By default, the replacements are disabled, the classic file locations are kept as static files, and the classic PKCS#11 module filename still refers to the classic module provided by the NSS cryptographic library.
In order to enable legacy applications, that read the classic files or access the classic module name, to make use of the new consolidated and dynamic configuration feature, the compatible replacements can be enabled using the update-ca-trust enable command.
When enabled, the classic filenames are changed to symbolic links. The symbolic links will refer to dynamically created and consolidated output stored below the /etc/pki/ca-trust/extracted directory hierarchy.
The output is produced using the update-ca-trust command (without parameters), or using the update-ca-trust extract command. In order to produce the output, a flexible set of source configuration is read, as described in section SOURCE CONFIGURATION.
In addition, if the replacements are enabled, the classic PKCS#11 module is replaced by a new PKCS#11 module (p11-kit-trust.so) that dynamically reads the same source configuration.
Use the update-ca-trust check command to display the enabled or disabled state of the compatible replacements.
On computer systems that used modified copies of the classic configuration files, prior to enabling the compatible replacements, a manual migration of the systemcqs CA and trust configuration modifications is required. It is advisable to compare the active configuration with the original configuration that had been used as a base for the modified copies, because software active on the system may depend on past modifications to the classic configuration files.
Alternatively, on a system with modified copies of the classic configuration files, you may accept to lose any past configuration modifications and forcefully switch to the most recent set of standard CA certificates and trust, using the update-ca-trust force-enable command.
When using the update-ca-trust enable or update-ca-trust force-enable commands, backups of the classic configuration files will be created in the /etc/pki/backup-traditional-original-config (on the first execution) and /etc/pki/backup-traditional-recent-config (on the first on all subsequent executions) directories. The backup files will be restored when disabling the compatible replacements using the update-ca-trust disable or update-ca-trust force-disable commands.
DISABLED OR ENABLED COMPATIBLE REPLACEMENTS
When disabled (default):
- * classic configuration files containing CA trust bundles in the PEM or JAVA keystore file formats are still being used
- * the classic PKCS#11 module named libnssckbi.so, which provides CA trust and distrust information, primarily used by applications that use the NSS cryptographic library, still refers to the classic module provided by the NSS cryptographic library.
When enabled:
- * classic configuration files containing CA trust bundles in the PEM or JAVA keystore file formats are replaced with symbolic links that resolve to consolidated and dynamically updated files below the /etc/pki/ca-trust/extracted directory hierarchy.
- * the classic PKCS#11 module named libnssckbi.so, which provides CA trust and distrust information, primarily used by applications that use the NSS cryptographic library, refers to the replacement p11-kit-trust.so module
The classic filenames and the classic PKCS#11 module mentioned above are:
- * /etc/pki/tls/cert.pem
- * /etc/pki/tls/certs/ca-bundle.crt
- * /etc/pki/tls/certs/ca-bundle.trust.crt
- * /usr/lib/libnssckbi.so
- * /usr/lib64/libnssckbi.so
SOURCE CONFIGURATION
The dynamic configuration feature uses several source directories that will be scanned for any number of source files. It is important to select the correct subdirectory for adding files, as the subdirectory defines how contained certificates will be trusted or distrusted, and which file formats are read.
Files in subdirectories below the directory hierarchy /usr/share/pki/ca-trust-source/ contain CA certificates and trust settings in the PEM file format. The trust settings found here will be interpreted with a low priority.
Files in subdirectories below the directory hierarchy /etc/pki/ca-trust/source/ contain CA certificates and trust settings in the PEM file format. The trust settings found here will be interpreted with a high priority.
You may use the following rules of thumb to decide, whether your configuration files should be added to the /etc or rather to the /usr directory hierarchy:
- * If you are manually adding a configuration file to a system, you probably want it to override any other default configuration, and you most likely should add it to the respective subdirectory in the /etc hierarchy.
- * If you are creating a package that provides additional root CA certificates, that is intended for distribution to several computer systems, but you still want to allow the administrator to override your list, then your package should add your files to the respective subdirectory in the /usr hierarchy.
- * If you are creating a package that is supposed to override the default system trust settings, that is intended for distribution to several computer systems, then your package should install the files to the respective subdirectory in the /etc hierarchy.
QUICK HELP 1: To add a certificate in the simple PEM or DER file formats to the list of CAs trusted on the system:
- * add it as a new file to directory /etc/pki/ca-trust/source/anchors/
- * run update-ca-trust extract
QUICK HELP 2: If your certificate is in the extended BEGIN TRUSTED file format (which may contain distrust/blacklist trust flags, or trust flags for usages other than TLS) then:
- * add it as a new file to directory /etc/pki/ca-trust/source/
- * run update-ca-trust extract
In order to offer simplicity and flexibility, the way certificate files are treated depends on the subdirectory they are installed to.
- * simple trust anchors subdirectory: /usr/share/pki/ca-trust-source/anchors/ or /etc/pki/ca-trust/source/anchors/
- * simple blacklist (distrust) subdirectory: /usr/share/pki/ca-trust-source/blacklist/ or /etc/pki/ca-trust/source/blacklist/
- * extended format directory: /usr/share/pki/ca-trust-source/ or /etc/pki/ca-trust/source/
In the main directories /usr/share/pki/ca-trust-source/ or /etc/pki/ca-trust/source/ you may install one or multiple files in the following file formats:
- * certificate files that include trust flags, in the BEGIN/END TRUSTED CERTIFICATE file format (any file name), which have been created using the openssl x509 tool and the -addreject -addtrust options. Bundle files with multiple certificates are supported.
- * files in the p11-kit file format using the .p11-kit file name extension, which can (e.g.) be used to distrust certificates based on serial number and issuer name, without having the full certificate available. (This is currently an undocumented format, to be extended later. For examples of the supported formats, see the files shipped with the ca-certificates package.)
- * certificate files without trust flags in either the DER file format or in the PEM (BEGIN/END CERTIFICATE) file format (any file name). Such files will be added with neutral trust, neither trusted nor distrusted. They will simply be known to the system, which might be helpful to assist cryptographic software in constructing chains of certificates. (If you want a CA certificate in these file formats to be trusted, you should remove it from this directory and move it to the ./anchors subdirectory instead.)
In the anchors subdirectories /usr/share/pki/ca-trust-source/anchors/ or /etc/pki/ca-trust/source/anchors/ you may install one or multiple certificates in either the DER file format or in the PEM (BEGIN/END CERTIFICATE) file format. Each certificate will be treated as trusted for all purposes.
In the blacklist subdirectories /usr/share/pki/ca-trust-source/blacklist/ or /etc/pki/ca-trust/source/blacklist/ you may install one or multiple certificates in either the DER file format or in the PEM (BEGIN/END CERTIFICATE) file format. Each certificate will be treated as distrusted for all purposes.
Please refer to the x509(1) manual page for the documentation of the BEGIN/END CERTIFICATE and BEGIN/END TRUSTED CERTIFICATE file formats.
Applications that rely on a static file for a list of trusted CAs may load one of the files found in the /etc/pki/ca-trust/extracted directory. After modifying any file in the /usr/share/pki/ca-trust-source/ or /etc/pki/ca-trust/source/ directories or in any of their subdirectories, or after adding a file, it is necessary to run the update-ca-trust extract command, in order to update the consolidated files in /etc/pki/ca-trust/extracted/ .
Legacy applications that rely on classic filenames benefit from configuration updates only if the functionally compatible replacements are enabled.
Applications that use the classic PKCS#11 module libnssckbi.so on a system with enabled compatible replacements, and any application capable of loading PKCS#11 modules and loading p11-kit-trust.so, will benefit from the dynamically merged set of certificates and trust information stored in the /usr/share/pki/ca-trust-source/ and /etc/pki/ca-trust/source/ directories.
EXTRACTED CONFIGURATION
The directory /etc/pki/ca-trust/extracted/ contains generated CA certificate bundle files which are created and updated, based on the SOURCE CONFIGURATION by running the update-ca-trust extract command.
If your application isncqt able to load the PKCS#11 module p11-kit-trust.so, then you can use these files in your application to load a list of global root CA certificates.
Please never manually edit the files stored in this directory, because your changes will be lost and the files automatically overwritten, each time the update-ca-trust extract command gets executed.
In order to install new trusted or distrusted certificates, please rather install them in the respective subdirectory below the /usr/share/pki/ca-trust-source/ or /etc/pki/ca-trust/source/ directories, as described in the SOURCE CONFIGURATION section.
The directory /etc/pki/ca-trust/extracted/java/ contains a CA certificate bundle in the java keystore file format. Distrust information cannot be represented in this file format, and distrusted certificates are missing from these files. File cacerts contains CA certificates trusted for TLS server authentication.
The directory /etc/pki/ca-trust/extracted/openssl/ contains CA certificate bundle files in the extended BEGIN/END TRUSTED CERTIFICATE file format, as described in the x509(1) manual page. File ca-bundle.trust.crt contains the full set of all trusted or distrusted certificates, including the associated trust flags.
The directory /etc/pki/ca-trust/extracted/pem/ contains CA certificate bundle files in the simple BEGIN/END CERTIFICATE file format, as decribed in the x509(1) manual page. Distrust information cannot be represented in this file format, and distrusted certificates are missing from these files. File tls-ca-bundle.pem contains CA certificates trusted for TLS server authentication. File email-ca-bundle.pem contains CA certificates trusted for E-Mail protection. File objsign-ca-bundle.pem contains CA certificates trusted for code signing.
COMMANDS
(absent/empty command)
- Same as the extract command described below. (However, the command may print fewer warnings, as this command is being run during rpm package installation, where non-fatal status output is undesired.)
check
- Report consistency status, and whether the compatible CA trust replacements are currently enabled or disabled.
disable
- Check the consistency status, and if no problems are detected, disable the compatible CA trust replacements, thereby reverting to the classic configuration. Restores previously backuped classic configuration files.
enable
- Check the consistency status, and if no problems are detected, enable the compatible CA trust replacements. Backup copies of classic configuration files will be created.
extract
- Instruct update-ca-trust to scan the SOURCE CONFIGURATION and produce updated versions of the consolidated configuration files stored below the /etc/pki/ca-trust/extracted directory hierarchy.
force-enable
- Enable the compatible CA trust replacements regardless of inconsistencies. Backup copies of classic configuration files will be created.
force-disable
- Disable the compatible CA trust replacements regardless of inconsistencies, thereby reverting to the classic configuration. Restores previously backuped classic configuration files.
FILES
/etc/pki/tls/certs/ca-bundle.crt
- Legacy filename, file contains a list of CA certificates trusted for TLS server authentication usage, in the simple BEGIN/END CERTIFICATE file format, without distrust information. If compatible CA trust replacements are disabled, this is a static file and will remain unchanged. Only if compatible CA trust replacements are enabled, this file is a symbolic link that refers to the consolidated output created by the update-ca-trust command.
/etc/pki/tls/certs/ca-bundle.trust.crt
- Legacy filename, file contains a list of CA certificates in the extended BEGIN/END TRUSTED CERTIFICATE file format, which includes trust (and/or distrust) flags specific to certificate usage. If compatible CA trust replacements are disabled, this is a static file and will remain unchanged. Only if compatible CA trust replacements are enabled, this file is a symbolic link that refers to the consolidated output created by the update-ca-trust command.
/etc/pki/java/cacerts
- Legacy filename, file contains a list of CA certificates trusted for TLS server authentication usage, in the Java keystore file format, without distrust information. If compatible CA trust replacements are disabled, this is a static file and will remain unchanged. Only if compatible CA trust replacements are enabled, this file is a symbolic link that refers to the consolidated output created by the update-ca-trust command.
/usr/share/pki/ca-trust-source
- Contains multiple, low priority source configuration files as explained in section SOURCE CONFIGURATION. Please pay attention to the specific meanings of the respective subdirectories.
/etc/pki/ca-trust/source
- Contains multiple, high priority source configuration files as explained in section SOURCE CONFIGURATION. Please pay attention to the specific meanings of the respective subdirectories.
/etc/pki/ca-trust/extracted
- Contains consolidated and automatically generated configuration files for consumption by applications, which are created using the update-ca-trust extract command. Doncqt edit files in this directory, because they will be overwritten. See section EXTRACTED CONFIGURATION for additional details.
AUTHOR
Written by Kai Engert and Stef Walter.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- DISABLED OR ENABLED COMPATIBLE REPLACEMENTS
- SOURCE CONFIGURATION
- EXTRACTED CONFIGURATION
- COMMANDS
- FILES
- AUTHOR
This document was created by man2html, using the manual pages.
Time: 05:34:31 GMT, December 24, 2015


list item 1
list item 2
list item 3
list item 4
list item 5
Before
addBack()
First Paragraph
Second Paragraph
After
addBack()
First Paragraph
Second Paragraph


Here are workout that you can do while traveling, or when you can’t make it to the gym. Remember, there are no excuses!
- For Time
- 5 Push-ups
- 5 Squats
- 5 Sit-ups
"Susan"
- 5 Rounds:
- Run 200m
- 10 Squats
- 5 Push-ups
- 15 Min. AMRAP
- 10 Push-ups
- 50 Mountain Climbers
- 25 Sit-ups
"Crazy Tens"
- 10 Rounds:
- 10 Push-ups
- 10 Sit-ups
- 25 Squats


This sample demonstrates how to write driver for a generic PCI device using Windows Driver Framework. The target hardware for this driver is PLX9656/9653RDK-LITE board. The product kit and the hardware specification are available at http://www.plxtech.com.
Following table gives a typical device and driver scenario and also lists the driver framework interfaces demonstrated in this sample:
|
Scenario |
Features Demonstrated |
|
The device is a PCI device with port, memory, interrupt and DMA resources. Device can be stopped and started at run-time and also supports low power states.
The driver is capable of doing concurrent read and write operations to the device but it can handle only one read or write request at any time. |
· Handling PnP & Power Events · Registering a Device Interface · Hardware resource mapping: Port, Memory & Interrupt · DMA Interfaces · Serialized Default Queue for Write requests · Serialized custom Queue for Read requests · Handling Interrupt & DPC |
This sample works on Windows® 2000 and later operating systems.
This sample driver is a minimal driver meant to demonstrate the usage of the Windows Driver Framework. It is not intended for use in a production environment.
To build the sample drivers, you must first set up the DDK environment on your host machine. The “Installation and Release Notes” in the Windows 2000/XP/Server 2003/Vista/Server 2008/Windows 7 DDK has a complete description on how to do this.
Change to the directory containing the device source code, such as CD src\general\PLX9x5x.
Run build -ceZ, or use the macro BLD. This command invokes the Microsoft make routines to build the components. If the build succeeds, you will find the driver, PLX9x5x.sys in one of the subdirectories depending on the build environment. If it fails you can find errors and warnings in the buildxxx.err and buildxxx.err respectively, where xxx is either chk or fre depending on the build environment. Copy the KMDF coinstaller (wdfcoinstallerMMmmm.dll), sys, INF and test binary to a floppy or to a directory of a test machine.
When you plug in the device and login into the Administrator account, the system will welcome you with a ‘Found New Hardware Dialog’.
On Windows 7 and later operating systems:
1. Launch “Device Manager” by executing command devmgmt.msc in a command window, or from “Hardware and Sound” program group in Control Panel.
2. Select “PCI Device” device from “Other Devices” category and click “Update Driver Software…” from right-click menu.
3. Select Browse my computer for software and provide the location of the driver files.
4. Select “Install this driver software anyway” when the “Windows Security” dialog box appears.
5. The system will complete the installation, load the driver and start the device.
On Windows Vista and Windows Server 2008:
1. In the “Found New Hardware” dialog box, select “Locate and install driver software (recommended)”.
2. Select “Don't search online”.
3. Select “I don't have the disc. Show me other options”.
4. Select “Browse my computer for driver software (advanced)”.
5. Enter the location of the driver files, and select “Install this driver software anyway” when the “Windows Security” dialog box appears.
6. The system will complete the installation, load the driver and start the device.
On Windows XP and Windows Server 2003:
1. Select 'Install from a list or specific location (Advanced)”, then click Next.
2. Select ‘Add a new hardware device’ from the list, then click Next.
3. Select ‘Select for the best drivers in these locations' and then select, “Include this location in the search path” check box and specify the media or the directory that contains the driver package and then click Next.
4. You will get a Security Alert about installing unsigned driver. Ignore that and continue the installation by clicking on “Yes”.
5. The system will complete the installation, load the driver and start the device.
On Windows 2000:
1. Select “Display list of known devices so that I can a specific device”, and then click Next.
2. Select the “Other Class” in the Hardware type, and click Next.
3. Click on the ‘Have Disk’ and specify the media or the directory that contains the driver files, and then click Next.
4. You will get a warning message about installing unsigned driver. Ignore that and continue the installation.
NOTE: Please do not load this driver on a checked build Windows 2000. There is a known issue with WdfInterruptAcquireLock().
To test the driver, run the PLX.EXE test application.
|
|
© 2002 Microsoft Corporation


Various functions to make simple primitives
Methods
-
create3DFVertices() → {Object.<string, TypedArray>}
-
Creates 3D 'F' vertices. An 'F' is useful because you can easily tell which way it is oriented. The created 'F' has position, normal and uv streams.
Returns:
The created plane vertices.
- Type
- Object.<string, TypedArray>
-
createCubeVertices(size) → {Object.<string, TypedArray>}
-
Creates the vertices and indices for a cube. The cube will be created around the origin. (-size / 2, size / 2)
Parameters:
Name Type Description size
number Width, height and depth of the cube.
Returns:
The created plane vertices.
- Type
- Object.<string, TypedArray>
-
createPlaneVertices(width, depth, subdivisionsWidth, subdivisionsDepth, matrix) → {Object.<string, TypedArray>}
-
Creates XZ plane vertices. The created plane has position, normal and uv streams.
Parameters:
Name Type Argument Description width
number <optional>
Width of the plane. Default = 1
depth
number <optional>
Depth of the plane. Default = 1
subdivisionsWidth
number <optional>
Number of steps across the plane. Default = 1
subdivisionsDepth
number <optional>
Number of steps down the plane. Default = 1
matrix
Matrix4 <optional>
A matrix by which to multiply all the vertices.
Returns:
The created plane vertices.
- Type
- Object.<string, TypedArray>
-
createSphereVertices(radius, subdivisionsAxis, subdivisionsHeight, opt_startLatitudeInRadians, opt_endLatitudeInRadians, opt_startLongitudeInRadians, opt_endLongitudeInRadians) → {Object.<string, TypedArray>}
-
Creates sphere vertices. The created sphere has position, normal and uv streams.
Parameters:
Name Type Argument Description radius
number radius of the sphere.
subdivisionsAxis
number number of steps around the sphere.
subdivisionsHeight
number number of vertically on the sphere.
opt_startLatitudeInRadians
number <optional>
where to start the top of the sphere. Default = 0.
opt_endLatitudeInRadians
number <optional>
Where to end the bottom of the sphere. Default = Math.PI.
opt_startLongitudeInRadians
number <optional>
where to start wrapping the sphere. Default = 0.
opt_endLongitudeInRadians
number <optional>
where to end wrapping the sphere. Default = 2 * Math.PI.
Returns:
The created plane vertices.
- Type
- Object.<string, TypedArray>
-
createTruncatedConeVertices(bottomRadius, topRadius, height, radialSubdivisions, verticalSubdivisions, opt_topCap, opt_bottomCap) → {Object.<string, TypedArray>}
-
Creates vertices for a truncated cone, which is like a cylinder except that it has different top and bottom radii. A truncated cone can also be used to create cylinders and regular cones. The truncated cone will be created centered about the origin, with the y axis as its vertical axis. The created cone has position, normal and uv streams.
Parameters:
Name Type Argument Description bottomRadius
number Bottom radius of truncated cone.
topRadius
number Top radius of truncated cone.
height
number Height of truncated cone.
radialSubdivisions
number The number of subdivisions around the truncated cone.
verticalSubdivisions
number The number of subdivisions down the truncated cone.
opt_topCap
boolean <optional>
Create top cap. Default = true.
opt_bottomCap
boolean <optional>
Create bottom cap. Default = true.
Returns:
The created plane vertices.
- Type
- Object.<string, TypedArray>
-
deindexVertices(vertices) → {Object.<string, TypedArray>}
-
Given indexed vertices creates a new set of vertices unindexed by expanding the indexed vertices.
Parameters:
Name Type Description vertices
Object.<string, TypedArray> The indexed vertices to deindex
Returns:
The deindexed vertices
- Type
- Object.<string, TypedArray>
-
flattenNormals(vertices) → {Object.<string, TypedArray>}
-
flattens the normals of deindexed vertices in place.
Parameters:
Name Type Description vertices
Object.<string, TypedArray> The deindexed vertices who's normals to flatten
Returns:
The flattened vertices (same as was passed in)
- Type
- Object.<string, TypedArray>
-
makeRandomVertexColors(vertices, options) → {Object.<string, augmentedTypedArray>}
-
Creates an augmentedTypedArray of random vertex colors. If the vertices are indexed (have an indices array) then will just make random colors. Otherwise assumes they are triangless and makes one random color for every 3 vertices.
Parameters:
Name Type Argument Description vertices
Object.<string, augmentedTypedArray> Vertices as returned from one of the createXXXVertices functions.
options
RandomVerticesOptions <optional>
options.
Returns:
same vertices as passed in with
color
added.- Type
- Object.<string, augmentedTypedArray>
-
reorientDirections(array, matrix) → {Array.<number>|TypedArray}
-
Reorients directions by the given matrix..
Parameters:
Name Type Description array
Array.<number>| TypedArray The array. Assumes value floats per element.
matrix
Matrix A matrix to multiply by.
Returns:
the same array that was passed in
- Type
- Array.<number>| TypedArray
-
reorientNormals(array, matrix) → {Array.<number>|TypedArray}
-
Reorients normals by the inverse-transpose of the given matrix..
Parameters:
Name Type Description array
Array.<number>| TypedArray The array. Assumes value floats per element.
matrix
Matrix A matrix to multiply by.
Returns:
the same array that was passed in
- Type
- Array.<number>| TypedArray
-
reorientPositions(array, matrix) → {Array.<number>|TypedArray}
-
Reorients positions by the given matrix. In other words, it multiplies each vertex by the given matrix.
Parameters:
Name Type Description array
Array.<number>| TypedArray The array. Assumes value floats per element.
matrix
Matrix A matrix to multiply by.
Returns:
the same array that was passed in
- Type
- Array.<number>| TypedArray
-
reorientVertices(arrays, matrix) → {Object.<string, (Array.<number>|TypedArray)>}
-
Reorients arrays by the given matrix. Assumes arrays have names that contains 'pos' could be reoriented as positions, 'binorm' or 'tan' as directions, and 'norm' as normals.
Parameters:
Name Type Description arrays
Object.<string, (Array.<number>|TypedArray)> The vertices to reorient
matrix
Matrix matrix to reorient by.
Returns:
same arrays that were passed in.
- Type
- Object.<string, (Array.<number>|TypedArray)>
Type Definitions
-
RandomColorFunc(ndx, channel) → {number}
-
Used to supply random colors
Parameters:
Name Type Description ndx
number index of triangle/quad if unindexed or index of vertex if indexed
channel
number 0 = red, 1 = green, 2 = blue, 3 = alpha
Returns:
a number from 0 to 255
- Type
- number
-
RandomVerticesOptions
-
Type:
- Object
Properties:
Name Type Argument Description vertsPerColor
number <optional>
Defaults to 3 for non-indexed vertices
rand
RandomColorFunc <optional>
A function to generate random numbers


Report: Israeli murdered in Mexico by American roommate
The American suspect, Timothy Robert N., reportedly stabbed the Israeli victim, then shot him multiple times with a pistol.
by Sara RubensteinMexican police arrested an American citizen over the weekend for allegedly murdering his Israeli roommate, a Channel 12 News report said.
Mexican media reported that the two men, both in their fifties, were roommates at Residencial Valle del Lago. On Friday, the two began arguing and the confrontation became violent.
The American suspect, Timothy Robert N., stabbed the Israeli and then shot him multiple times with a pistol. He later fled the apartment but the police located him and he is currently in custody.
The body of the Israeli victim is scheduled to undergo an autopsy on Sunday.


Company profile - Canadian Company Capabilities
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
Westkey Graphics Ltd.
Mailing Address:
8315 Riverbend CrtBURNABY, British Columbia
V3N 5E7
Location Address:
8315 Riverbend CrtBURNABY, British Columbia
V3N 5E7
Tel.:<PHONE_NUMBER>
Tel.:<PHONE_NUMBER>
Fax:<PHONE_NUMBER>
Company Profile
Westkey Graphics is a Canadian owned and operated company with its head office and manufacturing facilities based in Burnaby, Vancouver, British Columbia.
Westkey is West Canada's largest independent one stop shop printer offering a world class customer service and outstanding print quality. Westkey has one of the most knowledgeable teams of printing professionals in North America that provides customized printing solutions and distribution services including warehousing, on-line procurement and inventory management.
Westkey employs more than 150 full-time staff running 3 shifts 24 hours per day from its 150,000 sq. ft manufacturing facility and offers a wide range of printing including business forms, cheques, labels, digital printing, envelopes, commercial printing and various forms of integrated promotional products such as labels and magnets.
With our plant operating 24 hours a day, you can be sure your job will be completed in the fastest time frame possible without compromising quality.
In addition to our Vancouver manufacturing plant, Westkey has
offices in Edmonton, Calgary, Abbotsford and Kelowna.
Full profile
Full profile
Contact information
Company description
Product / Service / Licensing
statements and cheques, we can produce forms with as many as 14
parts using up to eight colours of ink. We can also help you
streamline your manufacturing and shipping departments by
integrating labels and/or bar codes onto your forms. Almost any
manufacturing option is available including a variety of paper
colours and weights, back printing, perforations, gluing,
crimping and so much more!
Snap sets: At Westkey every form is a custom form because we
have the ability to give you exactly what you want at an
affordable price, including one to eight colours of ink,
different weights and colours of paper, NCR paper, carbon and
patterned carbon. Back printing, perforations, punching and
numbering can all be done online. We can also shrinkwrap any
quantity as well as book your forms in several different
functional options.
Laser sheets, laser jumbo rolls and laser cheques: Whether you
want a simple laser sheet with your logo on it or an invoice
laser sheet with perforations and debit M.I.C.R., we can produce
all custom combinations. We can also add integrated laser-
friendly labels and cards for shipping or marketing purposes
with the options of printing one colour on one side to full
process colour on both sides. In addition, we offer a variety of
pre-set laser cheque formats to match your software requirements.
Envelopes: With our specialized envelope press we can print both
stock and custom sized envelopes to match your other printed
business correspondence material. We can print envelopes in one
to four colours, face and back.
Full process colour marketing pieces: Bright vivid colours will
make your marketing materials stand out from the crowd. In
addition to high quality printing we can also fold, die cut,
glue, perforate, add integrated cards, labels, magnets and much
more to your marketing pieces. We will help you produce
marketing materials that will get results for your company
and/or clients. If you have an idea for a marketing piece, we
can find a way to make it happen. Westkey has one of the most
experienced teams of printing professionals in North America at
your service.
Digital printing: Get full process colour on your short run
printing - comparable quality at a fraction of the price. Many
of our customers tell us they are trying to reach niche markets
and need small quantities of high quality printed materials to
catch their customers attention. Printing from digital files
can give you high quality printed brochures, sell sheets,
presentations, flyers, folders, posters and other marketing
materials. Whether you create the files yourself or our in-house
design department does it for you, Westkey can help you produce
material that will wow your market.
Promotional marketing pieces: We have several products that are
extremely effective for special promotions, tradeshows or
contests. Scratch and win tickets can be printed on a variety of
paper stocks, in almost any size and with full process colour.
For your next promotion why not use pull-tab marketing pieces?
They are fun for customers and something they just cant resist
opening. We can also produce sweepstakes pieces with stickers or
labels with pressure sensitive or re-moistenable glue. We can
print everything from the envelope to the inserts and even help
you co-ordinate the delivery with our mail house service.
Integrated cards, magnets and labels: Turn your forms, mail-outs
and promotional printing into interactive marketing pieces.
Integrated cards are perfect for discount or frequent shopper
cards, membership cards, event passes, customer service
information cards or any other application where you need a
highly durable card at a very affordable price. Integrated
magnets can be added to forms and mailers so your customers
can stick your contact information on their fridge or filing
cabinet. A wide selection of materials is available for almost
every application.
Returnvelope® & self-mailing products: Perfect for fundraising
campaigns, surveys and order forms, this product provides you
with an interactive marketing piece which you can send out in a
mail or flyer drop. The product is designed so the customer can
fill out required information, tear off the envelope at one end
and then mail back their order or response.
Direct mail: If you have a marketing piece to send to your own
database of customers we can co-ordinate your entire campaign
through our mail house program. We can print, address, stuff,
seal and mail your marketing material so it gets out in a timely
fashion and at an affordable cost.
Booklets, newsletters and presentation folders: From a simple
instruction manual or test booklet to an elaborate full process
colour newsletter or presentation folder, Westkey can deliver.
Our in-house bindery offers quick turn around times and
professional service.
Labels: If labels are a large part of your day-to-day operations
and/or marketing, our knowledgeable sales team can help assess
your needs and provide products that will save you time and
money. Some of our label products include: mailing and shipping,
bar code, blown-on, integrated, pressure sensitive or re-
moistenable glue and laser or pin feed labels on rolls or sheets.
ATM rolls & thermal transfer rolls: As the leading supplier of
these products in Western Canada, you can be assured of both a
great price and great quality. These rolls are available in a
variety of standard sizes or we can customize them to meet your
specific needs.
Sector information
Total plant size:
Distribution of employees:
150Unique applications:
laser compatible integrated membership cards; ATMrolls; scratch & win products; Returnvelopes;
full color promotional printing; remoistenable
gluing; collating up to 14 parts; die cutting;
cross web gluing; warehousing; forms management;
integrated labels and magnets; prime labels, wide format printing
Key / Major clients:
Westkey provides products and services across North America servicing the needs of numerous major organisations spanning all types of industries.Success stories:
Westkey Graphics is a Canadian owned and operated company with its head office and manufacturing facilities based in Burnaby, Vancouver, British Columbia.Westkey is West Canada's largest independant one stop shop printer offering a world class customer service and outstanding print quality. Westkey has one of the most knowledgeable teams of printing professionals in North America that provides customized printing solutions and distribution services including warehousing, on-line procurement and inventory management.
Westkey employs more than 150 full-time staff running 3 shifts 24 hours per day from its 150,000 sq. ft manufacturing facility and offers a wide range of printing including business forms, cheques, labels, digital printing, envelopes, commercial printing and various forms of integrated promotional products such as labels and magnets.
With our plant operating 24 hours a day, you can be sure your job will be completed in the fastest time frame possible without compromising quality.
In addition to our Vancouver manufacturing plant, Westkey has
offices in Edmonton, Calgary, Abbotsford and Kelowna.
Third-Party Information Liability Disclaimer
Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.
Contacts
Contact information
Description
Company description
Products, services and licensing
Product / Service / Licensing
statements and cheques, we can produce forms with as many as 14
parts using up to eight colours of ink. We can also help you
streamline your manufacturing and shipping departments by
integrating labels and/or bar codes onto your forms. Almost any
manufacturing option is available including a variety of paper
colours and weights, back printing, perforations, gluing,
crimping and so much more!
Snap sets: At Westkey every form is a custom form because we
have the ability to give you exactly what you want at an
affordable price, including one to eight colours of ink,
different weights and colours of paper, NCR paper, carbon and
patterned carbon. Back printing, perforations, punching and
numbering can all be done online. We can also shrinkwrap any
quantity as well as book your forms in several different
functional options.
Laser sheets, laser jumbo rolls and laser cheques: Whether you
want a simple laser sheet with your logo on it or an invoice
laser sheet with perforations and debit M.I.C.R., we can produce
all custom combinations. We can also add integrated laser-
friendly labels and cards for shipping or marketing purposes
with the options of printing one colour on one side to full
process colour on both sides. In addition, we offer a variety of
pre-set laser cheque formats to match your software requirements.
Envelopes: With our specialized envelope press we can print both
stock and custom sized envelopes to match your other printed
business correspondence material. We can print envelopes in one
to four colours, face and back.
Full process colour marketing pieces: Bright vivid colours will
make your marketing materials stand out from the crowd. In
addition to high quality printing we can also fold, die cut,
glue, perforate, add integrated cards, labels, magnets and much
more to your marketing pieces. We will help you produce
marketing materials that will get results for your company
and/or clients. If you have an idea for a marketing piece, we
can find a way to make it happen. Westkey has one of the most
experienced teams of printing professionals in North America at
your service.
Digital printing: Get full process colour on your short run
printing - comparable quality at a fraction of the price. Many
of our customers tell us they are trying to reach niche markets
and need small quantities of high quality printed materials to
catch their customers attention. Printing from digital files
can give you high quality printed brochures, sell sheets,
presentations, flyers, folders, posters and other marketing
materials. Whether you create the files yourself or our in-house
design department does it for you, Westkey can help you produce
material that will wow your market.
Promotional marketing pieces: We have several products that are
extremely effective for special promotions, tradeshows or
contests. Scratch and win tickets can be printed on a variety of
paper stocks, in almost any size and with full process colour.
For your next promotion why not use pull-tab marketing pieces?
They are fun for customers and something they just cant resist
opening. We can also produce sweepstakes pieces with stickers or
labels with pressure sensitive or re-moistenable glue. We can
print everything from the envelope to the inserts and even help
you co-ordinate the delivery with our mail house service.
Integrated cards, magnets and labels: Turn your forms, mail-outs
and promotional printing into interactive marketing pieces.
Integrated cards are perfect for discount or frequent shopper
cards, membership cards, event passes, customer service
information cards or any other application where you need a
highly durable card at a very affordable price. Integrated
magnets can be added to forms and mailers so your customers
can stick your contact information on their fridge or filing
cabinet. A wide selection of materials is available for almost
every application.
Returnvelope® & self-mailing products: Perfect for fundraising
campaigns, surveys and order forms, this product provides you
with an interactive marketing piece which you can send out in a
mail or flyer drop. The product is designed so the customer can
fill out required information, tear off the envelope at one end
and then mail back their order or response.
Direct mail: If you have a marketing piece to send to your own
database of customers we can co-ordinate your entire campaign
through our mail house program. We can print, address, stuff,
seal and mail your marketing material so it gets out in a timely
fashion and at an affordable cost.
Booklets, newsletters and presentation folders: From a simple
instruction manual or test booklet to an elaborate full process
colour newsletter or presentation folder, Westkey can deliver.
Our in-house bindery offers quick turn around times and
professional service.
Labels: If labels are a large part of your day-to-day operations
and/or marketing, our knowledgeable sales team can help assess
your needs and provide products that will save you time and
money. Some of our label products include: mailing and shipping,
bar code, blown-on, integrated, pressure sensitive or re-
moistenable glue and laser or pin feed labels on rolls or sheets.
ATM rolls & thermal transfer rolls: As the leading supplier of
these products in Western Canada, you can be assured of both a
great price and great quality. These rolls are available in a
variety of standard sizes or we can customize them to meet your
specific needs.
Sector
Sector information
Total plant size:
Distribution of employees:
150Unique applications:
laser compatible integrated membership cards; ATMrolls; scratch & win products; Returnvelopes;
full color promotional printing; remoistenable
gluing; collating up to 14 parts; die cutting;
cross web gluing; warehousing; forms management;
integrated labels and magnets; prime labels, wide format printing
Key / Major clients:
Westkey provides products and services across North America servicing the needs of numerous major organisations spanning all types of industries.Success stories:
Westkey Graphics is a Canadian owned and operated company with its head office and manufacturing facilities based in Burnaby, Vancouver, British Columbia.Westkey is West Canada's largest independant one stop shop printer offering a world class customer service and outstanding print quality. Westkey has one of the most knowledgeable teams of printing professionals in North America that provides customized printing solutions and distribution services including warehousing, on-line procurement and inventory management.
Westkey employs more than 150 full-time staff running 3 shifts 24 hours per day from its 150,000 sq. ft manufacturing facility and offers a wide range of printing including business forms, cheques, labels, digital printing, envelopes, commercial printing and various forms of integrated promotional products such as labels and magnets.
With our plant operating 24 hours a day, you can be sure your job will be completed in the fastest time frame possible without compromising quality.
In addition to our Vancouver manufacturing plant, Westkey has
offices in Edmonton, Calgary, Abbotsford and Kelowna.


Menu
Home
do you wanna a break?
Test mail
CSS Beautifier
Pogona. Be designer is easy ;)
Home
list of resources to designers
Do you wanna a break?
Send


Zim dollar-bearer cheque boy is now unrecognisable..PICTURES
In 2008, a boy in the streets of Harare was spotted in delight as he carried huge amounts of cash in bundles of 200 000 Zimbabwean Bearers’ Cheque Dollars in a sign of Zimbabwe’s hyperinflation.
The picture went viral all over the world during Doctor Gideon Gono’s days at RBZ and has since been one of the iconic images in social media displaying vividly the economic turmoil that was and is still plaguing the entire country.
A recent picture of the same, but now-grown unidentified boy has emerged showing him eleven years later-smartly dressed and healthier.
IHARARE NEWS


Introduction
Learning tasks on structured data such as graphs may be achieved using different approaches, in this article, we'll discuss a technique using embeddings for link prediction. Link prediction refers to predicting the existence of unknown edges in a given graph, while embeddings are multidimensional arrays containing real values, they are representations for each vertex in a graph. Further, we will be working with the NBNE (Neighbor Based Node Embeddings) over an anonymized undirected and unweighted example graph extracted from the facebook, containing more than 4 thousand vertices and 88 thousand edges. The source-code for this example of the link prediction task is also provided at my github.Overview: how the NBNE and the link prediction works
The NBNE is a robust and fast algorithm for learning graph embeddings compared to others which are based on random walk techniques. Behind the scenes it uses the skipgram algorithm which was originally designed to handle text, however, a text might be seen as a graph where each vertex is a word and edges connect co-occurring words in a given context. Using this approach to it's advantage, the NBNE also creates permutations of the neighbors of each vertex, obeying a fixed window size, which is far more efficient and effective than the random walk based methods. The main idea on creating the embeddings is to try predicting a node given a set of it's neighbors. The embeddings produced may have arbitrary number of dimensions, in addition, those embeddings become the new representation for each node.Since the embeddings are representations of the graph nodes, we may use any classification algorithm to predict whether there should be a link between 2 given nodes in the graph. Therefore, after generating the embeddings for each node, all we must do is repeatedly randomly select edges or non-edges composed of vertices
u
and v
, concatenate their embeddings
forming a single larger array so this becomes a features array and, finally, set it's class to
correspond to whether it's an edge or non-edge in the input graph.
Just to clarify, a non-edge is the absence of an edge (or link)
between two vertices. It's very important to notice a few key points to this approach:
- not all edges and non-edges should be selected to compose the training data, the idea is to train the classifier with limited information on the graph. This strategy enables predicting links over all non presented cases of edges and non-edges;
-
the links and non-links should be selected at random obeying the same proportion. Consider, again, our
facebook example graph with 4039 nodes and 88234 links. It's non-links would be all the links
in the complementary graph (without self loops), i. e.,
4039 2 - 4039 - 88234 = 16221248
non-links. Therefore, if we define our links selection rate to be 10%, then we must select for training approximately 8823 links and the exact same amount for non-links (therefore we could not use 1622124 non-links , since it would make the dataset heavily imbalanced). The equilibrium must be 50%/50% for the best results, therefore, the number of links limits the number of instances we may use for both links and non links on the training dataset. This strategy is focused on maintained fairness for the predictions to be performed by our classifiers; - an ideal sampling rate would be 50%, in addition, the target links and non-links meant for prediction should be left out of the training. Therefore, if we are really interested in predicting if a non-link could actually be a yet unknown link in the graph, we must leave it out of the training;
- an example application of link prediction is: suppose you are working with chemistry and you'd like to know which chemical compounds react with each other. For that, you build a graph where each vertex represents a chemical compound and each link represents that those two compounds react together. Note that you'd only create links between compounds you know for sure to react together, while the compounds which you know for sure that do not react and the ones which you don't know if they react, you leave them without edges. As you have realized by now, comparing all 1000 chemical compounds with each other results in 499500 unique chemical tests to be performed (excluding tests with a chemical against itself), which can extremely expensive and time demanding. Link prediction would accelerate and make cheaper this process, it would give you the links which are likely to exist, reducing the practical (and potentially very expensive) testings to a much smaller set of chemicals combinations;
import numpy as np
import networkx as nx
from nbne import train_model
from os.path import join, abspath, dirname
from sklearn.preprocessing import normalize
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score, roc_auc_score, f1_score, precision_score, recall_score
from time import time
import xgboost
import tensorflow as tf
import os
import warnings
import xgboost_gpu
The file "xgboost_gpu" was created in this article
and is meant to facilitate the usage of XGBoost in the GPU.
Now let's create a function to facilitate obtaining each vertex emebedding from the NBNE, it
returns a 2D numpy.ndarray
where the i-th row represents the i-th node in the
networkx.Graph
"graph" and the respective associated columns represents the
embeddings of vertex i.
def get_nbne_embeddings(
graph,
num_permutations=10,
embedding_dimension=128,
window_size=5,
min_count=0,
min_degree=0,
workers=8,
dtype=np.float64
):
'''
Returns a 2D numpy.ndarray where the i-th row represent's the i-th node in the networkx.Graph "graph" and the
respective associated columns represents the embeddings of vertex i. Note that this function considers the names of
all nodes in the graph to be integers in the range [0, number of nodes in the graph], that allows for the
abstraction of mapping each vertex to a unique position in the numpy.ndarray, creating an efficient data structure
for later usage;
:param graph: a networkx.Graph representing the graph to extract the embeddings from;
:param num_permutations: a NBNE's parameter defining the number of permutations performed using the neighborhood of
a vertex;
:param embedding_dimension: the output number of dimensions for the embeddings of each vertex;
:param window_size: the window size used to predict a node given it's neighbours;
:param min_count: ignores all vertices with total frequency lower than this. Frequency here is considering the
occurrence of a vertex as a neighbour of other vertices;
:param min_degree: ignores all vertices with degree lower than this;
:param workers: number of threads Gensim's training uses (it's called by the NBNE internally);
:param dtype: the data type of the output embeddings numpy.ndarray;
:return:
* emb: a 2D numpy.ndarray where the i-th row represent's the i-th node in the networkx.Graph "graph" and the
respective associated columns represents the embeddings of vertex i. This structure is shaped as follows:
(number of vertices in the graph, embedding_dimension);
'''
model = train_model(
graph,
num_permutations=num_permutations,
output_file=None,
embedding_dimension=embedding_dimension,
window_size=window_size,
min_count=min_count,
min_degree=min_degree,
workers=workers
)
emb = np.empty(shape=(graph.number_of_nodes(), embedding_dimension), dtype=dtype)
for word in model.wv.index2entity:
emb[int(word), :] = model.wv.word_vec(word=word)
return emb
Following, let's create another function to facilitate reading the input graph from a file, loading it
into a networkx.Graph
structure:
def _read_graph(file_name, adj_matrix_dtype=np.float64):
'''
Retrieves from a graph from an "edgelist" file (check networkx documentation for more details on this specific file
format) specified by it's name without the associated operating system path. The file will be searched in the
"graphs" folder of this project, no error handling is performed.
:param file_name: the raw file name, i. e., without it's path. The path is assumed to be the "graphs" folder
inside this project on a cross-platform fashion;
:param adj_matrix_dtype: the data type to of the output "A" matrix;
:return:
Returns two versions of the same undirected graph:
* G: a networkx.Graph instance containing the file's structured data;
* A: a numpy.ndarray containing the equivalent adjacency matrix. This structure is mean't for greater
efficiency when generating the training data for link prediction;
'''
full_path = join(join(dirname(dirname(abspath(__file__))), "graphs"), file_name)
G = nx.read_edgelist(full_path)
A = nx.to_numpy_array(G, dtype=adj_matrix_dtype)
return G, A
Now let's create a function which takes as input an adjacency matrix representation of the graph and another
matrix mapping each vertex to it's corresponding embeddings and create a dataset contaning exactly 50%/50%
equilibrium between edges and non-edges. Keep in mind that for the scope of this work, we do not need to
give special treatment for any vertices in particular since we are not looking to solve problems related
to any of them in particular. In a real world problem, there could be vertices and edges requiring special
attention and, therefore, one might need to exclude from the traning data whatever characteristics that are
being targeted for prediction.
def assemble_balanced_link_prediction_data(A, emb, sampling_rate=0.5, dtype=np.float32):
'''
Generates class balanced training/testing data for graph "A" using it's embeddings "emb". This function
is meant to be used with
undirected unweighted/weighted graphs, since it only considers the upper diagonal of "A" due to efficiency purposes.
Self loops are also ignored;
:param A: a square 2D numpy.ndarray representing the graph's adjacency matrix;
:param emb: a 2D numpy.ndarray where each row represents a vertex from A and the columns represents the embeddings
matching the vertex in the same row;
:param sampling_rate: a float in the interval (0.0, 1.0] determining the rate at which links and non-links will be
sampled from the graph to be used in the training data produced;
:param dtype: the data type of the produced training data;
:return:
* X_train: a 2D numpy.ndarray representing the training features;
* y_train: a 1D numpy.ndarray representing the training labels/targets;
'''
n = A.shape[0]
max_instances = int((((n ** 2) - n) / 2) * sampling_rate)
zeros_idx, ones_idx = [], []
for i in range(n):
for j in range(i + 1, n - 1):
if float(A[i, j]) == 0.0:
zeros_idx.append((i, j, 0))
else:
ones_idx.append((i, j, 1))
dominant_class = 1 if len(ones_idx) > len(zeros_idx) else 0
np.random.shuffle(zeros_idx)
np.random.shuffle(ones_idx)
if dominant_class == 0:
zeros_idx = zeros_idx[:len(ones_idx)]
else:
ones_idx = ones_idx[:len(zeros_idx)]
if len(zeros_idx) + len(ones_idx) > max_instances:
diff = np.ceil(np.abs(len(zeros_idx) + len(ones_idx) - max_instances) / 2)
zeros_idx = zeros_idx[:-diff]
ones_idx = ones_idx[:-diff]
data = np.empty(shape=(len(zeros_idx) + len(ones_idx), 2 * emb.shape[1] + 1), dtype=dtype)
for k, (i, j, label) in enumerate(zeros_idx + ones_idx):
data[k, :emb.shape[1]] = emb[i, :]
data[k, emb.shape[1]:-1] = emb[j, :]
data[k, -1] = label
np.random.shuffle(data)
x = data[:, :-1]
y = data[:, -1]
return x, y
Time for another convenience function, just so a few relevant scores may be properly printed to the screen.
Since this is an imbalanced class problem, it's very interesting to take a look at metrics beyond the accuracy,
such as ROC AUC, F1, precision and recall.
def print_scores_summary(ytrue, ypredicted, training_time, inference_time, model_name="Model"):
def fmt_fixed_len(str, fixed_length=25):
assert fixed_length >= len(str)
n = fixed_length - len(str)
return str + (" " * n)
print("{} {} results {}".format("=" * 5, model_name, "=" * 5))
print("{}{:.2f}%".format(fmt_fixed_len("Accuracy:"), accuracy_score(ytrue, ypredicted) * 100))
print("{}{:.2f}%".format(fmt_fixed_len("ROC AUC:"), roc_auc_score(ytrue, ypredicted) * 100))
print("{}{:.2f}%".format(fmt_fixed_len("F1:"), f1_score(ytrue, ypredicted) * 100))
print("{}{:.2f}%".format(fmt_fixed_len("Precision:"), precision_score(ytrue, ypredicted) * 100))
print("{}{:.2f}%".format(fmt_fixed_len("Recall:"), recall_score(ytrue, ypredicted) * 100))
print("{} training time: {:.2f} seconds.".format(model_name, training_time))
print("{} inference time: {:.2f} seconds.".format(model_name, inference_time))
Another convenience function to create a deep learning model: a transformer neural network (NN). It's important
to notice that this transformer is composed only of the encoding part of a complete transformer model,
where the fully connected layers at the top (close to outputs of this NN) work as a decoder of some sort,
producing answers. The input features will be assumed to be embeddings in a positional encoding configuration.
def make_nn(input_size):
model_inputs = tf.keras.Input(shape=input_size, dtype=tf.float32)
#layer = tf.keras.layers.Reshape((2, -1))(model_inputs)
half = int(input_size / 2)
layer0 = tf.keras.layers.Reshape((1, -1))(model_inputs[:, :half])
layer1 = tf.keras.layers.Reshape((1, -1))(model_inputs[:, half:])
a0 = tf.keras.layers.MultiHeadAttention(num_heads=16, key_dim=16, value_dim=16, dropout=0.0)(layer0, layer0)
a00 = tf.keras.layers.LayerNormalization()(a0 + layer0)
a0 = tf.keras.layers.Concatenate(axis=1)([a0, a00])
a1 = tf.keras.layers.MultiHeadAttention(num_heads=16, key_dim=16, value_dim=16, dropout=0.0)(layer1, layer1)
a11 = tf.keras.layers.LayerNormalization()(a1 + layer1)
a1 = tf.keras.layers.Concatenate(axis=1)([a1, a11])
a2 = tf.keras.layers.MultiHeadAttention(num_heads=16, key_dim=16, value_dim=16, dropout=0.0)(layer0, layer1)
a22 = tf.keras.layers.LayerNormalization()(a2 + layer0 + layer1)
a2 = tf.keras.layers.Concatenate(axis=1)([a2, a22])
a3 = tf.keras.layers.MultiHeadAttention(num_heads=16, key_dim=16, value_dim=16, dropout=0.0)(layer1, layer0)
a33 = tf.keras.layers.LayerNormalization()(a3 + layer1 + layer0)
a3 = tf.keras.layers.Concatenate(axis=1)([a3, a33])
layer = tf.keras.layers.Concatenate(axis=1)([a0, a1, a2, a3])
partially_encoded = tf.keras.layers.Flatten()(layer)
layer = tf.keras.layers.Dense(128, activation="relu")(partially_encoded)
layer = tf.keras.layers.Dense(partially_encoded.shape[-1], activation="relu")(layer)
layer = tf.keras.layers.LayerNormalization()(layer + partially_encoded)
layer = tf.keras.layers.Concatenate(axis=-1)([layer, partially_encoded])
model_outputs = tf.keras.layers.Dense(128, activation="sigmoid")(layer)
model_outputs = tf.keras.layers.Dense(1, activation="sigmoid")(layer)
model = tf.keras.Model(inputs=model_inputs, outputs=model_outputs)
model.compile(optimizer="adam",
loss="binary_crossentropy",
metrics=["binary_accuracy", "AUC", tf.keras.metrics.FalsePositives(), tf.keras.metrics.TruePositives()]
)
return model
Finally, it's time to run the experiments. For better statistical relevance results, we should employ the
cross validation technique, however, only holdout will be employed, since this script will take quite some
time to execute and the focus of this tutorial is not on obtainng scores with high statistical quality.
if __name__ == "__main__":
start_time = time()
EMB_DIM_COUNT = 256
BATCH_SIZE = 128
with warnings.catch_warnings():
warnings.simplefilter("ignore")
"""
graph retrieved from the page "https://snap.stanford.edu/data/egonets-Facebook.html", by downloading the file
"facebook_combined.txt.gz". The full download link is "https://snap.stanford.edu/data/facebook_combined.txt.gz".
"""
read_graph_tstart = time()
graph_file_name = "facebook_combined.txt"
G, A = _read_graph(graph_file_name)
print("Graph read in: {:.2f} seconds".format(time() - read_graph_tstart))
emb_tstart = time()
emb = get_nbne_embeddings(
G,
num_permutations=10,
embedding_dimension=EMB_DIM_COUNT,
window_size=5,
min_count=0,
min_degree=3,
workers=8
)
# normalizing the embeddings should, generally, be a good a idea
emb = normalize(emb)
print("Vertices embeddings trained in: {:.2f} seconds".format(time() - emb_tstart))
# here, one might use sampling_rate=1.0 to combine the links and non-links between all vertices, then the data is
# split among training and testing by the sklearn.train_test_split
assemble_tstart = time()
x, y = assemble_balanced_link_prediction_data(A, emb, sampling_rate=0.10, dtype=np.float64)
xtrain, xtest, ytrain, ytrue = train_test_split(x, y, test_size=1/4, shuffle=True)
print("Training and testing data assembled in: {:.2f} seconds".format(time() - assemble_tstart))
xgb_train_tstart = time()
xgb_dict = xgboost_gpu.train_xgboost_gpu(
xtrain,
ytrain,
data_chunksize=None,
n_gpus=2,
n_threads_per_gpu=10,
params={"objective": "binary:logistic", "eval_metric": "logloss"}
)
xgb_model = xgb_dict['booster']
xgb_train_telapsed = time() - xgb_train_tstart
xgb_inference_tstart = time()
ypredicted = xgboost_gpu.predict_xgboost_gpu(
xgb_model,
xtest,
data_chunksize=None,
n_gpus=1,
n_threads_per_gpu=20,
)
ypredicted = np.round(ypredicted)
xgb_inference_telapsed = time() - xgb_inference_tstart
print_scores_summary(ytrue, ypredicted, xgb_train_telapsed, xgb_inference_telapsed, model_name="XGBoost (GPU)")
xgb_inference_tstart = time()
ypredicted = xgb_model.predict(xgboost.DMatrix(xtest, feature_names=[str(k) for k in range(xtest.shape[1])]))
ypredicted = np.round(ypredicted)
print("XGBoost (CPU) inference time: {:.2f} seconds.".format(time() - xgb_inference_tstart))
# =============================================================================
model = make_nn(EMB_DIM_COUNT * 2)
print(model.summary())
def scheduler(epoch, lr):
return lr * tf.math.exp(-0.06)
lr_scheduler = tf.keras.callbacks.LearningRateScheduler(scheduler)
transformer_train_tstart = time()
model.fit(xtrain, ytrain, epochs=50, batch_size=BATCH_SIZE, callbacks=[lr_scheduler])
cnn_train_telapsed = time() - transformer_train_tstart
cnn_inference_tstart = time()
ypredicted = model.predict(xtest)
ypredicted = np.round(ypredicted)
cnn_iference_telapsed = time() - cnn_inference_tstart
print_scores_summary(ytrue, ypredicted, cnn_train_telapsed, cnn_iference_telapsed, model_name="Transformer")
print("Total script execution time: {:.2f} seconds.".format(time() - start_time))
After removing lots of warnings, the output of this script should be similar to the following:
Graph read in: 0.33 seconds
Vertices embeddings trained in: 27.69 seconds
Training and testing data assembled in: 7.97 seconds
[15:07:19] task [xgboost.dask]:tcp://<IP_ADDRESS>:32897 got new rank 0
[15:07:19] task [xgboost.dask]:tcp://<IP_ADDRESS>:37085 got new rank 1
===== XGBoost (GPU) results =====
Accuracy: 87.24%
ROC AUC: 87.26%
F1: 87.88%
Precision: 83.46%
Recall: 92.79%
XGBoost (GPU) training time: 83.32 seconds.
XGBoost (GPU) inference time: 12.30 seconds.
XGBoost (CPU) inference time: 0.29 seconds.
*** lots of hidden warnings in this section ***
Model: "model"
__________________________________________________________________________________________________
Layer (type) Output Shape Param # Connected to
==================================================================================================
input_1 (InputLayer) [(None, 512)] 0
__________________________________________________________________________________________________
tf.__operators__.getitem (Slici (None, 256) 0 input_1[0][0]
__________________________________________________________________________________________________
tf.__operators__.getitem_1 (Sli (None, 256) 0 input_1[0][0]
__________________________________________________________________________________________________
reshape (Reshape) (None, 1, 256) 0 tf.__operators__.getitem[0][0]
__________________________________________________________________________________________________
reshape_1 (Reshape) (None, 1, 256) 0 tf.__operators__.getitem_1[0][0]
__________________________________________________________________________________________________
multi_head_attention_2 (MultiHe (None, 1, 256) 263168 reshape[0][0]
reshape_1[0][0]
__________________________________________________________________________________________________
multi_head_attention_3 (MultiHe (None, 1, 256) 263168 reshape_1[0][0]
reshape[0][0]
__________________________________________________________________________________________________
multi_head_attention (MultiHead (None, 1, 256) 263168 reshape[0][0]
reshape[0][0]
__________________________________________________________________________________________________
multi_head_attention_1 (MultiHe (None, 1, 256) 263168 reshape_1[0][0]
reshape_1[0][0]
__________________________________________________________________________________________________
tf.__operators__.add_2 (TFOpLam (None, 1, 256) 0 multi_head_attention_2[0][0]
reshape[0][0]
__________________________________________________________________________________________________
tf.__operators__.add_4 (TFOpLam (None, 1, 256) 0 multi_head_attention_3[0][0]
reshape_1[0][0]
__________________________________________________________________________________________________
tf.__operators__.add (TFOpLambd (None, 1, 256) 0 multi_head_attention[0][0]
reshape[0][0]
__________________________________________________________________________________________________
tf.__operators__.add_1 (TFOpLam (None, 1, 256) 0 multi_head_attention_1[0][0]
reshape_1[0][0]
__________________________________________________________________________________________________
tf.__operators__.add_3 (TFOpLam (None, 1, 256) 0 tf.__operators__.add_2[0][0]
reshape_1[0][0]
__________________________________________________________________________________________________
tf.__operators__.add_5 (TFOpLam (None, 1, 256) 0 tf.__operators__.add_4[0][0]
reshape[0][0]
__________________________________________________________________________________________________
layer_normalization (LayerNorma (None, 1, 256) 512 tf.__operators__.add[0][0]
__________________________________________________________________________________________________
layer_normalization_1 (LayerNor (None, 1, 256) 512 tf.__operators__.add_1[0][0]
__________________________________________________________________________________________________
layer_normalization_2 (LayerNor (None, 1, 256) 512 tf.__operators__.add_3[0][0]
__________________________________________________________________________________________________
layer_normalization_3 (LayerNor (None, 1, 256) 512 tf.__operators__.add_5[0][0]
__________________________________________________________________________________________________
concatenate (Concatenate) (None, 2, 256) 0 multi_head_attention[0][0]
layer_normalization[0][0]
__________________________________________________________________________________________________
concatenate_1 (Concatenate) (None, 2, 256) 0 multi_head_attention_1[0][0]
layer_normalization_1[0][0]
__________________________________________________________________________________________________
concatenate_2 (Concatenate) (None, 2, 256) 0 multi_head_attention_2[0][0]
layer_normalization_2[0][0]
__________________________________________________________________________________________________
concatenate_3 (Concatenate) (None, 2, 256) 0 multi_head_attention_3[0][0]
layer_normalization_3[0][0]
__________________________________________________________________________________________________
concatenate_4 (Concatenate) (None, 8, 256) 0 concatenate[0][0]
concatenate_1[0][0]
concatenate_2[0][0]
concatenate_3[0][0]
__________________________________________________________________________________________________
flatten (Flatten) (None, 2048) 0 concatenate_4[0][0]
__________________________________________________________________________________________________
dense (Dense) (None, 128) 262272 flatten[0][0]
__________________________________________________________________________________________________
dense_1 (Dense) (None, 2048) 264192 dense[0][0]
__________________________________________________________________________________________________
tf.__operators__.add_6 (TFOpLam (None, 2048) 0 dense_1[0][0]
flatten[0][0]
__________________________________________________________________________________________________
layer_normalization_4 (LayerNor (None, 2048) 4096 tf.__operators__.add_6[0][0]
__________________________________________________________________________________________________
concatenate_5 (Concatenate) (None, 4096) 0 layer_normalization_4[0][0]
flatten[0][0]
__________________________________________________________________________________________________
dense_3 (Dense) (None, 1) 4097 concatenate_5[0][0]
==================================================================================================
Total params: 1,589,377
Trainable params: 1,589,377
Non-trainable params: 0
__________________________________________________________________________________________________
None
*** lots of hidden warnings in this section ***
1034/1034 [==============================] - 16s 10ms/step - loss: 0.5300 - binary_accuracy: 0.7378 - auc: 0.8042 - false_positives: 10155.0261 - true_positives: 26739.1092
Epoch 2/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4662 - binary_accuracy: 0.7761 - auc: 0.8407 - false_positives: 10291.5981 - true_positives: 28671.6580
Epoch 3/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4491 - binary_accuracy: 0.7840 - auc: 0.8507 - false_positives: 10423.8000 - true_positives: 29261.0126
Epoch 4/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4374 - binary_accuracy: 0.7910 - auc: 0.8589 - false_positives: 10240.7614 - true_positives: 29658.6850
Epoch 5/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4314 - binary_accuracy: 0.7955 - auc: 0.8631 - false_positives: 10011.8541 - true_positives: 29622.2763
Epoch 6/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4206 - binary_accuracy: 0.8003 - auc: 0.8694 - false_positives: 9861.7014 - true_positives: 29771.5884
Epoch 7/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4154 - binary_accuracy: 0.8031 - auc: 0.8730 - false_positives: 9825.8048 - true_positives: 30090.4271
Epoch 8/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4043 - binary_accuracy: 0.8095 - auc: 0.8790 - false_positives: 9606.1662 - true_positives: 30175.4734
Epoch 9/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.4000 - binary_accuracy: 0.8108 - auc: 0.8819 - false_positives: 9511.9643 - true_positives: 30105.1217
Epoch 10/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3926 - binary_accuracy: 0.8138 - auc: 0.8863 - false_positives: 9363.8609 - true_positives: 30220.8531
Epoch 11/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3874 - binary_accuracy: 0.8185 - auc: 0.8896 - false_positives: 9143.9159 - true_positives: 30308.2155
Epoch 12/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3831 - binary_accuracy: 0.8198 - auc: 0.8923 - false_positives: 9055.1778 - true_positives: 30305.8135
Epoch 13/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3753 - binary_accuracy: 0.8247 - auc: 0.8971 - false_positives: 8810.5246 - true_positives: 30335.1652
Epoch 14/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3685 - binary_accuracy: 0.8289 - auc: 0.9004 - false_positives: 8632.9681 - true_positives: 30458.7710
Epoch 15/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3629 - binary_accuracy: 0.8306 - auc: 0.9040 - false_positives: 8534.1720 - true_positives: 30439.8860
Epoch 16/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3577 - binary_accuracy: 0.8324 - auc: 0.9066 - false_positives: 8401.9498 - true_positives: 30514.8966
Epoch 17/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3533 - binary_accuracy: 0.8361 - auc: 0.9092 - false_positives: 8210.9700 - true_positives: 30512.3362
Epoch 18/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3442 - binary_accuracy: 0.8406 - auc: 0.9150 - false_positives: 7980.7865 - true_positives: 30400.4850
Epoch 19/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3387 - binary_accuracy: 0.8436 - auc: 0.9169 - false_positives: 7829.1681 - true_positives: 30645.7836
Epoch 20/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3355 - binary_accuracy: 0.8435 - auc: 0.9188 - false_positives: 7699.4628 - true_positives: 30484.4705
Epoch 21/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3292 - binary_accuracy: 0.8474 - auc: 0.9223 - false_positives: 7601.1778 - true_positives: 30668.9266
Epoch 22/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3228 - binary_accuracy: 0.8510 - auc: 0.9252 - false_positives: 7374.0570 - true_positives: 30619.6541
Epoch 23/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3166 - binary_accuracy: 0.8532 - auc: 0.9283 - false_positives: 7167.6918 - true_positives: 30633.4522
Epoch 24/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3111 - binary_accuracy: 0.8576 - auc: 0.9311 - false_positives: 6969.4425 - true_positives: 30728.1275
Epoch 25/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3068 - binary_accuracy: 0.8600 - auc: 0.9330 - false_positives: 6842.7498 - true_positives: 30655.6280
Epoch 26/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.3007 - binary_accuracy: 0.8626 - auc: 0.9360 - false_positives: 6666.9024 - true_positives: 30776.8309
Epoch 27/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2958 - binary_accuracy: 0.8656 - auc: 0.9381 - false_positives: 6535.6609 - true_positives: 30812.5353
Epoch 28/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2920 - binary_accuracy: 0.8663 - auc: 0.9397 - false_positives: 6408.8386 - true_positives: 30698.3034
Epoch 29/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2820 - binary_accuracy: 0.8732 - auc: 0.9444 - false_positives: 6167.8870 - true_positives: 30931.4812
Epoch 30/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2783 - binary_accuracy: 0.8750 - auc: 0.9459 - false_positives: 6059.2222 - true_positives: 30877.8676
Epoch 31/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2710 - binary_accuracy: 0.8771 - auc: 0.9489 - false_positives: 5938.6618 - true_positives: 30905.1546
Epoch 32/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2642 - binary_accuracy: 0.8813 - auc: 0.9516 - false_positives: 5741.9159 - true_positives: 30870.9362
Epoch 33/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2613 - binary_accuracy: 0.8825 - auc: 0.9526 - false_positives: 5658.9884 - true_positives: 30971.6213
Epoch 34/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2560 - binary_accuracy: 0.8863 - auc: 0.9548 - false_positives: 5460.2696 - true_positives: 31057.9691
Epoch 35/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2546 - binary_accuracy: 0.8860 - auc: 0.9552 - false_positives: 5440.5507 - true_positives: 31082.5565
Epoch 36/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2500 - binary_accuracy: 0.8895 - auc: 0.9568 - false_positives: 5302.9082 - true_positives: 31111.1372
Epoch 37/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2425 - binary_accuracy: 0.8936 - auc: 0.9595 - false_positives: 5127.5034 - true_positives: 31119.8696
Epoch 38/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2393 - binary_accuracy: 0.8946 - auc: 0.9609 - false_positives: 5014.7304 - true_positives: 31248.2077
Epoch 39/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2372 - binary_accuracy: 0.8952 - auc: 0.9614 - false_positives: 5014.2329 - true_positives: 31266.5169
Epoch 40/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2324 - binary_accuracy: 0.8988 - auc: 0.9633 - false_positives: 4820.1990 - true_positives: 31234.4831
Epoch 41/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2275 - binary_accuracy: 0.9006 - auc: 0.9652 - false_positives: 4756.8454 - true_positives: 31371.3585
Epoch 42/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2262 - binary_accuracy: 0.9019 - auc: 0.9653 - false_positives: 4653.3594 - true_positives: 31259.6164
Epoch 43/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2228 - binary_accuracy: 0.9038 - auc: 0.9668 - false_positives: 4614.2638 - true_positives: 31336.7855
Epoch 44/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2163 - binary_accuracy: 0.9061 - auc: 0.9686 - false_positives: 4508.0589 - true_positives: 31353.1295
Epoch 45/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2174 - binary_accuracy: 0.9052 - auc: 0.9683 - false_positives: 4497.6338 - true_positives: 31422.6155
Epoch 46/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2133 - binary_accuracy: 0.9091 - auc: 0.9696 - false_positives: 4326.9874 - true_positives: 31362.6300
Epoch 47/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2117 - binary_accuracy: 0.9094 - auc: 0.9705 - false_positives: 4297.6763 - true_positives: 31451.0039
Epoch 48/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2082 - binary_accuracy: 0.9111 - auc: 0.9713 - false_positives: 4250.7536 - true_positives: 31519.3575
Epoch 49/50
1034/1034 [==============================] - 11s 10ms/step - loss: 0.2047 - binary_accuracy: 0.9133 - auc: 0.9724 - false_positives: 4169.1855 - true_positives: 31545.2029
Epoch 50/50
1034/1034 [==============================] - 10s 10ms/step - loss: 0.2041 - binary_accuracy: 0.9134 - auc: 0.9724 - false_positives: 4155.9420 - true_positives: 31504.6271
===== Transformer results =====
Accuracy: 83.96%
ROC AUC: 83.98%
F1: 84.55%
Precision: 81.33%
Recall: 88.03%
Transformer training time: 536.54 seconds.
Transformer inference time: 4.41 seconds.
Total script execution time: 674.73 seconds.
Note that the above code was executed in a very powerful machine running Ubuntu 16.04 with 128 GB of
RAM, 10-cores 20-threads CPU, 2 GPUs RTX 3090 with 24 GB of dedicated RAM each, multiple SSDs, among more.
Source-code
Available on my github page, written in Python. A documentation of the code is provided in the "README.md" file, as well as docstrings in the source-code itself.Requirements
- python==3.8.3
- gensim==3.8.3
- dask==2.30.0
- networkx==2.5
- pandas==1.1.3
- dask_cuda==0.18.0
- xgboost==1.3.3
- nbne==0.81
- tensorflow==2.4.1
- numpy==1.19.2
- scikit_learn==0.24.1
Conclusion
Working with imbalanced problems in machine learning is difficult, in general. It's generally a good idea to ensure that classes are balanced so the models may evenly learn internal characteristics which fairly favors all the output classes, however, that doesn't mean the models will output all classes with the same probability distribution as the training set. The difference, as already mentioned and it must be hightlighted, lies in the learned elements from the dataset, even though the predictions will be performed on a imbalanced set of samples.
Further, there are more complex link prediction problems which require more advanced techniques. For an example, we could be dealing with graphs which carry more information than just connections between vertices, they could contain vectors associated to each vertex and/or edge, the graph could also be a multigraph where there are multiple types of vertices and edges interacting together.
Cheers!
gmmoliveira1@gmail.com


Before Change
prev_max=self.max_action_range_tensor_serving,
)
rewards = Variable(torch.from_numpy(training_samples.rewards).type(self.dtype))
next_states = Variable(
torch.from_numpy(training_samples.next_states).type(self.dtype)
)
time_diffs = torch.tensor(training_samples.time_diffs).type(self.dtype)
discount_tensor = torch.tensor(np.full(len(rewards), self.gamma)).type(
self.dtype
)
After Change
actions = Variable(actions)
if isinstance(training_samples.next_states, torch.Tensor):
next_states = training_samples.next_states.type(self.dtype)
else:
next_states = torch.from_numpy(training_samples.next_states).type(
self.dtype
)
next_states = Variable(next_states)
// As far as ddpg is concerned all actions are [-1, 1] due to actor tanh
actions = rescale_torch_tensor(
actions,


{% extends "_layouts/layout.html" %}
{% set productName = "Digital Marketplace" %}
{% set homepage_url = "/govuk-digital-marketplace/" %}
{% set phase = "beta" %}
{# Product nav URLs and link text #}
{% set navItems = [
['https://www.gov.uk/government/collections/digital-marketplace-buyers-and-suppliers-information', 'Guidance'],
['support', 'Help'],
['https://pay-staff-tool-2.herokuapp.com/sign-in', 'Log in']
] %}


THE-BOT
login
register
Hello
Email
Password
Connect
Forgotten password?
Welcome
First Name
Last Name
Email
Email Confirmation
Password
Password Confirmation
Submit


Dr. Norman Borlaug
Dr.Norman Borlaug
Here's a time line of Dr. Borlaug's life:
Read More About Dr Norman Borlaug


rotary debugger
`Prev `__
R
`Next `__
--------------
**rotary debugger**: n.
[Commodore] Essential equipment for those late-night or early-morning
debugging sessions. Mainly used as sustenance for the hacker. Comes in
many decorator colors, such as Sausage, Pepperoni, and Garbage. See
`*ANSI standard pizza* <../A/ANSI-standard-pizza.html>`__.
--------------
+--------------------------+----------------------------+------------------------+
| `Prev `__ | `Up <../R.html>`__ | `Next `__ |
+--------------------------+----------------------------+------------------------+
| rot13 | `Home <../index.html>`__ | RSN |
+--------------------------+----------------------------+------------------------+


| Constellation Action | Keyboard Shortcut | User Action | Menu Icon |
|---|---|---|---|
| Open Delimited File Importer | File -> Import -> From Delimited File... |
The "Import From Delimited File" window allows you to import data from the following sources:
The following is a high level workflow an analyst can follow (explained in detail later on):
Hints:
Add files to import using the and remove a file using the . Once a file has been selected, the full name will appear. If the entire file location is not visible, extend the window to see the full name.
Once you add a file, the Configuration section will display the first 100 rows of the file as a preview. If you have imported multiple files, selecting the file will update the preview.
With the "Initialise With Schema" option enabled, new nodes and transactions added to the graph will follow the rules governed by the schema. If this is not enabled, nodes imported will not have attributes such as label and icon defined.
Select the destination graph from the drop-down list. Once selected, the attributes in the configuration pane update depending on what attributes are supported by the schema of that graph.
Applying an attribute to the column is simple as dragging and dropping an attribute onto a column in the preview.
By default, not all attributes available to the selected schema are visible because there can be an overwhelming number of attributes depending on the schema. To see all possible attributes you can apply to a graph go to Options -> Show all schema attributes.
If you have a specific format for example the DateTime, then you can right click on the DateTime attribute and select the format from the drop down list or enter your own.
If you want to create your own attributes then you can by clicking on and selecting a type and entering a label.
By default, transactions are created as directed. In the Transaction Attributes column there is a pseudo-attribute called "__directed__" (different from "directed") which can be used to create directed and undirected transactions as required. The "__directed__" pseudo-attribute is a boolean that will cause a transaction to be directed when its value is "true" (case insensitive), and undirected otherwise.
Once your configuration is finished, import the entire file with the format you have applied by clicking on the Import button located at the bottom right hand corner.
An import configuration can be saved as a template, and loaded at a later time, using the "Options" menu in the top left corner.
When a template is saved, the import definition name is used to name the saved query. If a query of that name has already been saved, you will be asked if you want to overwrite it. Templates are saved in the directory "<HOME_DIRECTORY>/.CONSTELLATION/ImportDelimited". (The name of the file in which the template is saved is encoded so it doesn't clash with file system limitations.) Files in this directory can be deleted using your favourite file management utility.
Before loading a template, select the files you want to import. The loaded template then attempts to match the column names it knows with the column names in the current files. If a template is loaded before any files are selected, there are no columns to match against.
When you select "Load...", you will be presented with a list of saved templates. Select one from the list and select Ok. The template will be loaded and will appear as it was when it was saved.
To share the template do the following:
NOTE: The .json filename should not change!


PHILADELPHIA A film review by Steve Rhodes Copyright 1995 Steve Rhodes
RATING (0 TO ****): *** 1/2
Although PHILADELPHIA could have been a better movie, more about this latter, I really liked it, especially for Tom Hank's extremely moving performance as someone dying of AIDS. There are many parts of the movie that I will remember for a long time, but most of all is the courtroom scene where Tom Hanks testifies in his own behalf. Hanks's performance deserves an Oscar, but many other parts of that scene were outstanding. His makeup throughout the movie is chillingly realistic especially how pale he looks at court.  Overall, it really makes you think: there but for the grace of God go I.
There are two other excellent parts of the show. The family, especially his mother played by Joanne Woodward, is loving and stands behind him without being judgmental and the characters in the family are not overdrawn. Another excellent scene is the costume ball. You can really see the love and the happiness even in times of trouble that this group of gay friends have. The script by Ron Nyswaner is outstanding as is the directing by Jonathan Demme. Demme is one of my favorite directors. His long repertoire of wonderful movies include: SILENCE OF THE LAMBS, MARRIED TO THE MOB, SWIMMING TO CAMBODIA, and my personal favorite SOMETHING WILD. I recommend you rent them all many times.
The movie could and should have been even better. The homophobia was over done. The scene in the drug store where someone tried to pick up Denzel Washington starts off fine, but then goes overboard, ditto for the bar scene, Washington's home scene, etc. Also, Washington's character was not well written. He started off hating gay people and by the middle and end of the movie, it was unclear what he thought.
 Chief among these was the scene where Hanks has to babble a long soliloquy signifying nothing while listening to Opera music. Finally, both lawyers at the trial were too low key for such an important case, and Mary Steenbergen was terribly miscast as she frequently is. Her script was so bad on the other hand, you kind of had to kind of feel sorry for her. She has a very limited range of acting abilities, but seems to be cast in widely differing roles.
PHILADELPHIA runs 2:05 and given all of the material it covers, I don't think it could be made much shorter. It is rated PG-13 for its serious themes. I highly recommend this show to everyone over 12 and award it *** 1/2. Now, go see the movie. The good parts are excellent, and the bad parts can be ignored.
**** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEW WRITTEN ON: January 22, 1994
Opinions expressed are mine and not meant to reflect my employer's.
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


Waiter Analogy
This example was taken from this rigor blog.
At a restaurant, you are handed a menu of items that you can order. You can then add specific instructions about how you want those items prepared.

The waiter writes down your order and delivers it to the kitchen team, who prepares your meal to your exact specifications.
Once your meal is prepared, the waiter picks it up from the kitchen and serves it to you at your table. You review it to make sure that you have received everything you requested – and then you eat.
The waiter’s role in this scenario closely mirrors the role of an API in the delivery of data on the modern web. Like a waiter, an API:
- Receives a set of instructions (a request) from a source (such as an application or engineer)
- Takes that request to the database
- Fetches the requested data or facilitates a set of actions
- Returns a response to the source