MJXGUI is a widget style application meant to give users a graphical interface for creating equations to use on the web. It uses MathJax as a core dependency and as an external renderer to show users a preview of their equation as they write it. Once users have created their expression, it generates corresponding LaTeX for it for you to handle however you would like, the most common use case being to store an equation/expression as plain text so you can use it later with MathJax.
I wrote this library because I needed such a widget for a website where school teachers were supposed to create test questions for physics, chemistry, and math topics that needed complex mathematical equations.
The motivation was to have something like a pop-up widget that would help users build an expression graphically just as they do in Google Docs or Microsoft Word, but then would also convert the same equation into LaTeX so it could be rendered with MathJax later.
MJXGUI uses MathJax as a core dependency, so you need to include both MathJax as well as MJXGUI into your webpage. MJXGUI does not have a built in renderer, and uses MathJax to render the equations as they are being built.
Make sure you include MathJax before including MJXGUI.
Include the minified MJXGUI source file in your <head> tag by getting the source from GitHub.
MJXGUI works by showing your users a button/element prompting them to insert an equation. MJXGUI attaches event listeners to these elements and shows the editor UI when they are clicked.
Once the user is done entering the equation/expression, the editor UI disappears and a callback function that you supply is run. This callback function has access to the full internal API, from which you can access the generated LaTeX for the expression the user just entered. Make sure the callback function you supply is not an arrow function but a regular function.
Initialize MJXGUI by creating a new MJXGUI instance, which takes 3 parameters - a CSS selector, a math delimiter, and a callback function.
const gui = new MJXGUI(‘selector’, ‘delimiter’, function() {})
The selector is a CSS selector that should be able to select the elements you want users to click on to start entering an equation. MJXGUI adds click event listeners to all selected elements and shows the editor UI whenever they are clicked.
The delimiter is the math delimiter you use in your configuration of MathJax, usually ‘$$’. This tells MJXGUI to use the same delimiter while rendering the equation being built so that users can see it correctly.
The callback function is a function that is run when the user is done entering the equation and
clicks on the “Done” button. This is where you will be able to access the LaTeX for the equation.
The this
keyword inside this function will have access to the MJXGUI cursor, which
contains all the methods and properties used to build equations and generate LaTeX for them. Calling
this.getLatex()
will generate the LaTeX for the equation and return it to you
as a string.
You would build a minimal example as shown below. This example takes the LaTeX for the equation the user has created, appends it to the body, and typesets it using MathJax.
eqnOutput.innerHTML += '$$' + gui.getLatex() + '$$' + '<br>'; // NOTE - this.getLatex() would also work here
MathJax.typesetPromise([eqnOutput]).then(() => {});
})
</script>
The API documentation is ordered by the precedence of the modules in the structure of the code. The modules that lend their functions and/or classes to others are documented before the others. This is because reading the documentation in this order will help you understand how MJXGUI works from the ground up and will help you modify, customize, and extend it to include LaTeX symbols, functions, and characters not included by default.
You will most often interact with the API exposed by the MJXGUI class defined in the UI module. Refer to the UI section if you don’t want much customization and just want to integrate the default editor.
The expression backend defines the classes that represent different mathematical symbols, characters, and functions. It is responsible for building a representation of the equation the user is building and has methods to generate LaTeX for an equation once the user is done.
Each equation is made up of different “components”, that can represent a single character, symbol, or a mathematical function. A component is, in turn, made up of multiple “blocks” that can contain strings or other components to allow functions to be nested indefinitely.
For example, the equation
$${{ x = -b \pm \sqrt{b^2-4ac} \over 2a }}$$contains many components as well as blocks. Each character (“x”, “=”, and so on) is its own component (represented by a “TextComponent”). It also contains two functions, namely the fraction function and the square root function. The fraction function has two “blocks”, the numerator and denominator, and the square root function only has one block, the expression inside the square root symbol.
The expression that users enter is represented in the following way -
The equation is represented using the Expression class. An Expression can have multiple components (as described above). Each component is made up of blocks. Some components have one, some two, and some three. Each block can contain an arbitrary amount of “children.” The children can be strings which represent the characters that the user entered or some LaTeX data, like “\pi” or “x”, or the children can be another component nested inside this current component, as we saw that the square root function was nested inside the fraction function. In the above case, the numerator block of the fraction function had 4 children - [‘-’, ‘b’, MJXGUISymbol, Sqrt].
There are many types of components - characters, symbols, and functions - that inherit from the abstract Component class. The Component class has methods to manage the contents of its blocks and a method to generate LaTeX depending on the type of component it is.
As users type and choose characters/symbols/functions to insert, they are turned into their own components and added to the correct place using the current position of the cursor (see Controller). In short, we define a “cursor” that keeps track of where the user is inside the Expression. The user can move the cursor around using the arrow keys and whenever the user types in a character or chooses a component to insert, the component is inserted at the position of the cursor.
The Expression class is a wrapper around the Component class that collects all of the equation’s components together and has a method toLatex() that generates LaTeX for the components in it.
A thin wrapper around the Component class that collects all the components together into an Expression that can be easily rendered and converted to LaTeX.
Expression.components = [];
An array containing the components in this expression.
Expression.add(component, position=this.components.length)
Add a component in this expression at the given position.
Expression.remove(position=this.components.length-1)
Remove the component in this expression at the given position.
Expression.toLatex()
Generates LaTeX code from the components in this expression and returns it as a string.
A fundamental unit of the Expression. All data is ultimately stored in a Block. Every block has a children array that can contain either strings or other Components.
Block.children = [];
An array containing all data inside this block. Can contain strings containing characters or
LaTeX data, like “\pm”, “\infty”, or “x”, “=”, etc or component objects.
Block.parent = Component();
The component this block belongs to.
Block.addChild(component, position=this.children.length)
Add a component to this block’s children.
Block.removeChild(position=this.children.length-1)
Remove a component from this block’s children.
Represents a component in the expression array.
 Each component has a fixed number of
blocks. For example, the fraction function component has two blocks, the integration function
component has three blocks, etc. We add and remove blocks from components when we generate LaTeX
to show the user a preview of their equation.
Component.parent = Block;
The block this component is nested inside (if any). If this component is not nested then set to null.
Component.addBlock(block, position)
Add a block to this component at the given position.
Component.removeBlock(position)
Remove a block from this component at the given position.
Component.isEmpty()
Returns true if the component has no content in all of its blocks, false otherwise. Used to
check if the component is empty before we delete it when the user presses backspace.
Component.toLatex()
Generates LaTeX for this component by generating LaTeX for its blocks and combining them.
This method is meant to be overridden by each child class that inherits from Component to
customize the kind of LaTeX that is generated.
The controller module defines a Cursor class that represents the position of the user inside the expression. Whenever the user types a character or clicks on a button to add a component, we use the cursor position to determine where the character/component should be inserted. The Cursor class has properties to keep track of the user’s position in the overall expression, as well as the user’s position inside a specific block, and has methods to manipulate the expression’s contents.
To uniquely determine the user’s position in the expression, the cursor has a reference to the Expression instance, the instance of the Block it is inside, and the instance of Component it’s block is inside.
It also keeps track of the LaTeX of the expression as it is being built. However, you shouldn’t use this property to access the LaTeX of the final expression, since it contains an extra component that is added to represent the cursor itself. To get the LaTeX of the expression once the user is done entering it (or when you specifically want to access the LaTeX), use the Cursor’s toLatex() method, which will generate the correct LaTeX for you.
Cursor.expression = Expression
The expression the cursor is operating in.
Cursor.block = Block()
The Block the cursor is in. If the cursor is not inside any block, we set this to null..
Cursor.component = Component()
The component the cursor is inside. If the cursor is not inside any component, we set this to null. If
either Cursor.component or Cursor.block is null, the other has to be null as well. Conversely, if either
of Cursor.component or Cursor.block is non-null, the other has to be non–null as well.
Cursor.child = Number
A Number representing the position inside the block the cursor should be drawn. It can take values between
-0.5 to Cursor.block.children.length-0.5
. A child position of -0.5 means that the cursor should be drawn before
the first child in the block, a child position of 0.5 means it should be drawn between the first child in the
block (at index 0) and the second child (at index 1). This property can only take half-integral values.
Cursor.position = Number;
A Number representing the position of the cursor’s component inside the cursor’s expression. Can take values
\between -0.5 and Cursor.expression.components.length-0.5
in steps of 0.5. A position of -0.5 means
that the cursor is on the left side of the first component in the expression. A position of 0 means that the cursor is
somewhere inside the first component in the expression (index 0 of Cursor.expression.components
). A position of 0.5 means
that the cursor is between the first and second components of the expression, and so on.
Cursor.latex = String
A String containing the LaTeX of the equation that the cursor’s expression contains.
Cursor.display = String || HTML Element
Either a String or an HTML element corresponding to the editor UI’s display.
Cursor.addText(text: String)
Adds some text to the expression at the position of the cursor. Called for each character we want to insert.
Cursor.addComponent(component: Component)
Inserts a component into the expression at the position of the cursor and changes the cursor’s position and
child attributes accordingly.
Cursor.removeComponent()
Removes the component that the cursor is currently in and changes the cursor’s position and child attributes accordingly.
Cursor.keyPress(event: Event)
Passed as an event listener callback to listen for the user’s key presses. If the user presses a key, then it adds the
corresponding character to the expression. If the user presses special keys like backspace, left arrow, right arrow,
etc, it appropriately calls Cursor.backspace()
, Cursor.seekLeft()
, or Cursor.seekRight()
.
Cursor.seekRight()
Handles the logic for what to do when the user presses the right arrow key.
Cursor.seekLeft()
Handles the logic for what to do when the user presses the left arrow key.
Cursor.backspace()
Handles the logic for what to do when the user presses the backspace key.
Cursor.toLatex()
Generates LaTeX for the equation represented by the cursor’s expression. Call
this method to get the LaTeX you want once the user is done entering their equation.
Cursor.toDisplayLatex()
Generates LaTeX to show the user a preview of the equation they are building by adding a
caret and a box around the active block.
Cursor.updateDisplay()
Updates the editor UI’s display to update the equation being previewed. Called every time
the user makes a change to the equation or the cursor’s position and child.
The UI module defines the main MJXGUI class that exposes the API to the developer.
MJXGUI.elements = String
A CSS selector that selects the DOM elements that will show the editor. Click event listeners
are added to all elements selected by this selector and the editor UI is shown whenever the user
clicks on one of those elements.
MJXGUI.mathDelimiter = String
A string representing the delimiter you use for MathJax for displayMath ( MathJax.tex.displayMath
).
Usually ‘$$’.
MJXGUI.successCallback = function
A function that will be called when the user finishes typing the equation and clicks the editor’s “Done” button.
This is where you will be able to access the LaTeX for the equation created by the user.
MJXGUI.eqnHistory = []
An array containing all the previous equations the user has entered.
MJXGUI.expression = Expression
The current Expression object being built by the user right now.
MJXGUI.cursor = Cursor
The Cursor instance.
MJXGUI.constructUI()
Creates a new editor and injects its HTML and CSS into the DOM.
You won’t need to call this method yourself, it is automatically called when you create a new instance of MJXGUI.
MJXGUI.clearEquation()
Disconnects the current Expression object that was being built from the cursor and pushes it onto the eqnHistory
array. Also creates a new Expression object, sets it as the current expression, resets the cursor’s properties back
to the defaults, and clears the display.
MJXGUI.getLatex()
Generates and returns the LaTeX for the current Expression.


from keras.models import load_model
with open(file_name, "rb") as read_file:
base_pipeline = dill.load(read_file)
for step in base_pipeline.named_steps:
pipeline_step = base_pipeline.named_steps[step]
try:
return base_pipeline
def load_keras_model(file_name):
return load_ml_model(file_name)
def make_deep_learning_model(hidden_layers=None, num_cols=None, optimizer="adam", dropout_rate=0.2, weight_constraint=0, feature_learning=False):


Caption 1: put anything you want in the caption. Note that there is a link in the image
Caption 2: put anything you want in the caption. Note that there is a link in the image
Caption 3: put anything you want in the caption. Note that there is a link in the image
Caption 4: put anything you want in the caption. Note that there is a link in the image
Caption 5: put anything you want in the caption. Note that there is a link in the image
1
2
3
4
5
remove panel:
1
2
3
4
5
Parameters:
Axis
horizontal
vertical
Circular
Duration (ms)
Tab demo, using the Matrix plugin.
Feel free to try and/or modify.
Twitter
|
Blog


@(key: String) @main("Here's your chess gif") {
This image is not stored on the server for long, better save it.


Table of Contents
Progressive Web Apps are very much in use by some of the biggest companies like Twitter, Forbes, Alibaba, Instagram, Flipkart e.t.c and have gained popularity. Building a PWA is quite easy and simple. In this tutorial, we’re going to build a simple Progressive web app (A weight converter app). Let’s roll :)
INTRODUCTION
I’m sure by now you must have heard or read about Progressive Web Applications. Progressive Web Applications are experiences that combine the best of web applications features and the best of mobile applications features. They use service workers, HTTPS, a manifest file and an app shell architecture to deliver native app experiences to web applications.
The term Progressive Web Apps was first coined by Frances Berriman and Alex Russell in 2015, as a way of describing applications that take advantage of new features supported by modern browsers, including service workers and web app manifests.
Progressive Web Apps are largely characterized by the following:
- Reliable — They load instantly and never show the “No Internet Connection” page, even in uncertain network conditions with help from Service workers caching.
- Fast — They respond quickly to user interactions with smooth animations.
- Engaging — They feel like a natural app on the device, with immersive user experience.
WHY BUILD PROGRESSIVE WEB APPS?
Building a high-quality Progressive Web App has incredible benefits, making it easy to delight your users, grow engagement and increase traffic.
- They’re installable — if a user visits your website for the second, third, or fourth time, they get the option of adding it to their home screen. (Desktop, Android or iOS) After that, it works like a mobile application.
- They’re indexable — your app is visible in the browsers and so it’s searchable for users.
- They work offline — once you download it to your device, you can cache contents from the app without an Internet connection. Your users will never see the running downasaur :)
- They can send push notifications — once a new article/product/piece of news shows up on your website, your users will be notified just like every mobile app out there.
- They cut down page load times — as proved by housing.com, PWAs can significantly reduce page load times and thus improve overall UX.
- They are progressive — They will work for any user on any device even with a poor internet connection.
THE THREE BASIC CRITERIA FOR A PWA
- You need to be running on HTTPS
- You need a web manifest
- You need a service worker
Here’s a video from Google I/O ‘17 that explains in depth about Progressive Web Apps. Learn how PWA’s huge reach, low friction, high re-engagement and lower costs work for developers and businesses. This talk details new ways of building and distributing Progressive Web Apps on Android and other OSes that let you reach more users.
STARTER FILES
You can find the starter repository here with all files and final demo here
APP DESCRIPTION
We’re going to build a simple weight converter that converts a given weight from Pounds to its equivalent in Gram, Kilogram and Ounce.
This project is just to help you understand how PWA’s work, after this, you can build your own project. We’d use Bootstrap 4 for the UI and JavaScript for the main functionality.
Here’s how the final project looks:
BUILDING THE UI
Now, let’s build the User interface of our application.
First, create the following files
index.html
css/app.css
js/app.js
img/favicon.png
(Use any .png image)
Now. let’s build the markup
— In index.html
, add this
We’ve added some Bootstrap classes already in index.html
but we have not included Bootstrap CDN yet. In app.css
we’re going to do that.
— Add this in css/app.css
Now your app should look like this:
ADD JAVASCRIPT FUNCTIONALITY
Basically, we want to get the input value from the input field and process then return results to each of the following id’s:
gOutput
for Grams,kgOutput
for Kilogram,ozOutput
for Ounces. Inindex.html
, we wrapped all this id’s inoutput
. We also want to hide the results and display after a user enters a value in the input field.
Here is how we convert weight from Pounds to its equivalent in Gram, Kilogram and Ounce
- 1 Gram = Pounds/ 0.0022046
- 1 Kilogram = Pounds/ 2.2046
- 1 Ounce = Pounds * 16
— Add this in js/app.js
This is just basic JavaScript, if you have no idea what all this means, you should get JavaScript Teacher’s
Grammar JavaScript
book. This will teach you all the basics and contents of Modern JavaScript. Get a free copy here.
Now you should have a functioning app
BUILD THE PROGRESSIVE WEB APP
The three basic criteria for a PWA:
- Service worker
A service worker is a script that allows your browser to run in the background, separate from a web page, opening the door to features that don’t need a web page or user interaction. Today, they already include features like push notifications and background sync. Read more
- Manifest file
The web app manifest is a simple JSON file that tells the browser about your web application and how it should behave when ‘installed’ on the user’s mobile device or desktop. Having a manifest is required by Chrome to show the Add to Home Screen prompt. Read more
- Icons
This icons control your application and are provided in different sizes for different devices. Your PWA app will not work without them.
Now let’s get started.
Before we proceed, ensure you’re using a live server
Use (Web server for Chrome, or VSCode Live Server)
Create the following files:
sw.js
(In root directory)manifest.json
(In root directory)img/icons
(Where we’d store our icons
First, we need to check if the browser supports service workers and register a new one.
In js/app.js
add
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('../sw.js').then( () => {
console.log('Service Worker Registered')
})
})
}
If the browser supports it, you should get this in your console
Your final app.js
should look like this
We’re going to use the Workbox library to power our service worker
Workbox is a set of libraries and Node modules developed by Google that make it easy to cache assets and take full advantage of features used to build Progressive Web Apps.
The idea of our service worker is to cache all files (Fonts, JavaScript, CSS, Images, e.t.c) so we can access them offline after the page loads.
The important thing to understand about the Service Worker is that you are in control of the network. You get to decide what is cached, how it is cached and how it should be returned to the user.
— In sw.js
, add this:
So basically we imported workbox-sw.js
which is Workbox’s service worker file, then we checked if Workbox is loaded in our own service worker.
if (workbox) {
console.log(`Yay! Workbox is loaded 🎉`);
} else {
console.log(`Boo! Workbox didn't load 😬`);
}
One of Workbox’s primary features is it’s routing and caching strategy modules. It allows you to listen for requests from your web page and determine if and how that request should be cached and responded to.
Routing in Workbox is the process of a Router matching a request to a route and the route then handling that request (i.e. providing a response).
In sw.js
, we did something like this:
workbox.routing.registerRoute(
/\.(?:js|css|scss)$/,
new workbox.strategies.StaleWhileRevalidate(),
);
Basically, this tells Workbox that when a request is made, it should see if the regular expression matches part of the URL (.css, .scss, .js
) and if it does, cache that file.
The StaleWhileRevalidate()
function allows us to use this cache in our application but still update in the background if the file has changed. You would need to refresh again to see the new files.
Precaching a file will ensure that a file is downloaded and cached before a service worker is installed, meaning that if your service worker is installed, your files will be cached.s
Now our service worker works and would cache files once the page loads.
Now let’s make our app installable.
— Add this in manifest.json
Your PWA Icons sizes should be in
px
and in the following sizes:72x72
,96x96
,128x128
,144x144
,152x152
,192x192
,384x384
,512x512
You can use the Web Manifest Generator to generate your
manifest.json
Now we need to connect our web app to the manifest to allow “add to home screen” from that page. Add this to your index.html
<link rel="manifest" href="/manifest.json" />
<meta name="theme-color" content="#333" />
If you have multiple pages, you need to add this to all of them.
You can also use the same
theme-color
you used inmanifest.json
here
Now your final index.html
should look like this (PS: I’ve added some SEO tags)
Now caching will begin once the page loads
Congratulations, you’ve successfully built your first Progressive Web App.
It can be installed on Mobile (Android and iOS) and Desktop.
DESKTOP
MOBILE
DEPLOYING TO NETLIFY
Now let’s deploy our app to Netlify.
Netlify is an all-in-one workflow that combines global deployment, continuous integration, and automatic HTTPS. It builds, deploys, and manage modern web projects.
Before you proceed, ensure you’ve hosted this project on GitHub, GitLab or BitBucket.
- Create an account on https:/.netlify.com
- Click new site from Git
- Choose your Git provider
- Select your repository (Here I named it
weight-converter
)
- Click “Deploy site”
- Bingo!! It’s done
If you make any changes to your repository, Netlify will deploy automatically.
PS: Netlify generates random domains for each app deployed, you can change that in Domain settings.
CONCLUSION
Building a high-quality Progressive Web App has incredible benefits, making it easy to delight your users, grow engagement and increase conversions.
- Worthy of being on the home screen
When the Progressive Web App criteria are met, Chrome prompts users to add the Progressive Web App to their home screen. - Work reliably, no matter the network conditions
Service workers enabled Konga to send 63% fewer data for initial page loads, and 84% fewer data to complete the first transaction! - Increased engagement
Web push notifications helped eXtra Electronics increase engagement by 4X.  - Improved conversions
The ability to deliver an amazing user experience helped AliExpress improve conversions for new users across all browsers by 104% and on iOS by 82%.
— Source: Google Developer’s
Check the PWA Checklist created by Google to help teams create the best possible experiences. This checklist breaks down all the things it takes to be a Baseline PWA, and how to take that a step further with an Exemplary PWA by providing a more meaningful offline experience, reaching interactive even faster and taking care of many more important details.
Thank you for reading!


Assistant Professor of Philosophy
Professor of Philosophy
R. Taylor Cole Professor of Philosophy
Associate Professor of Philosophy
Assistant Professor of Philosophy
Professor of Germanic Languages and Literature
Associate Professor of Political Science
Frederic Cleavland Professor of Law and Political Science
Professor of Political Science
Professor of Political Science
Lecturing Fellow of Political Science
Assistant Professor of Political Science
Edmund T. Pratt, Jr. University Professor of Political Science
Professor of Religious Studies and African American Studies/Philosophy
Associate Professor of Political Science
Professor of Asian and Middle Eastern Studies/Political Science
Associate Professor of Political Science
Associate Professor of Public Policy
Director of Programs at Duke University’s Forum for Scholars and Publics
Professor of Economics
Adjunct Assistant Professor at Fuqua School of Business
Professor of Economics
Professor of Economics
W.R. Huff Professor of the Practice in Economics
Professor of Economics
Professor of Economics
Professor of Economics
Professor of Economics


1-1
1-2
1-3
1-4
1-5
1-6
2-1
2-2
2-3
2-4
2-5
2-6
3-1
3-2
3-3
3-4
3-5
3-6
Click Play
Click Replay
Restricted Click Play
Restricted Click Replay
Type Play


Astropy 0.3 is a major release that adds significant new functionality since the 0.2.x series of releases. This release sees the addition of the Modeling sub-package, which provides an initial framework for fitting models to data, and the Virtual Observatory sub-package, which implements cone searches. In addition, there have been many improvements to the existing sub-packages, such as a much faster implementation of quantities for Numpy arrays in the Units and Quantities sub-package, a better integration of units and quantities in other sub-packages (such as the Cosmology sub-package), new Table functionality related to joining and aggregation, support for arrays in the Coordinates sub-package, and a re-structuring of the Convolution code to provide many build-in parameterized kernels. We describe the new sub-packages and the main improvements below.
For a detailed list of all the changes, including deprecated features and backward-incompatible changes, please take a look at the full Full Changelog.
The Models And Fitting (astropy.modeling) sub-package defines many built-in 1-D and 2-D models and provides an extensible framework for fitting these to data. The following example demonstrates how to easily define a Gaussian model and fit it to a previously defined dataset:
import numpy as np
from astropy.modeling import models, fitting
# Generate fake data
np.random.seed(0)
x = np.linspace(-5., 5., 200)
y = 3 * np.exp(-0.5 * (x - 1.3)**2 / 0.8**2)
y += np.random.normal(0., 0.2, x.shape)
# Fit the data
g_init = models.Gaussian1D(amplitude=1., mean=0, stddev=1.)
f2 = fitting.NonLinearLSQFitter()
g = f2(g_init, x, y)
# Plot the results
plt.figure(figsize=(8,5))
plt.plot(x, y, 'ko')
plt.plot(x, g(x), 'r-', lw=2)
plt.xlabel('Position')
plt.ylabel('Flux')
(Source code, png, hires.png, pdf)
Note
Since this is a new sub-package, it should be considered experimental and will be significantly improved in future. In particular, the ability to fit composite models (such as the sum of two models) will be added in the next major version (in the mean time, users can define their own models for such cases). More complete examples and a full description of the sub-package is provided in Models And Fitting (astropy.modeling).
The new Virtual Observatory Access (astropy.vo) sub-package currently provides the ability to execute cone searches. To see a list of available catalogs, you can first import the cone search module:
>>> from astropy.vo.client import conesearch
then make use of the list_catalogs() function:
>>> conesearch.list_catalogs()
[u'Guide Star Catalog 2.3 1',
u'SDSS DR7 - Sloan Digital Sky Survey Data Release 7 1',
u'SDSS DR7 - Sloan Digital Sky Survey Data Release 7 2',
u'SDSS DR7 - Sloan Digital Sky Survey Data Release 7 3',
u'SDSS DR7 - Sloan Digital Sky Survey Data Release 7 4',
u'SDSS DR8 - Sloan Digital Sky Survey Data Release 8 1',
u'SDSS DR8 - Sloan Digital Sky Survey Data Release 8 2',
u'The HST Guide Star Catalog, Version 1.1 (Lasker+ 1992) 1',
u'The HST Guide Star Catalog, Version 1.2 (Lasker+ 1996) 1',
u'The HST Guide Star Catalog, Version GSC-ACT (Lasker+ 1996-99) 1',
u'The PMM USNO-A1.0 Catalogue (Monet 1997) 1',
u'The USNO-A2.0 Catalogue (Monet+ 1998) 1',
u'Two Micron All Sky Survey (2MASS) 1',
u'Two Micron All Sky Survey (2MASS) 2',
u'USNO-A2 Catalogue 1',
u'USNO-A2.0 1']
The following example shows how to execute a cone search for a radius of 0.1 degrees around M31 from the 2MASS catalog. First, we can extract the coordinates for M31 from SIMBAD:
>>> from astropy import coordinates as coords
>>> c = coords.ICRS.from_name('M31')
>>> c
<ICRS RA=10.68471 deg, Dec=41.26875 deg>
and we can then execute the query:
>>> from astropy import units as u
>>> twomass = 'Two Micron All Sky Survey (2MASS) 1'
>>> result = conesearch.conesearch(c, 0.1 * u.degree, catalog_db=twomass)
Trying http://wfaudata.roe.ac.uk/twomass-dsa/DirectCone?DSACAT=TWOMASS&...
Downloading ...
The result is returned as a astropy.io.votable.tree.Table instance (note that this is different from the generic astropy.table.table.Table class):
>>> result.url
u'http://wfaudata.roe.ac.uk/twomass-dsa/DirectCone?DSACAT=TWOMASS&DSATAB=twomass_psc&'
>>> result.array.size
2008
>>> result.array['ra']
masked_array(data = [10.620983 10.672264 10.651166 ..., 10.805599],
mask = [False False False ..., False],
fill_value = 1e+20)
Converting to an astropy.table.table.Table is straightforward:
>>> table = result.to_table()
>>> print(table)
cx cy cz ... coadd_key coadd
-------------- -------------- -------------- ... --------- -----
0.739345466303 0.138832922929 0.658857876152 ... 1590591 33
0.73937055914 0.138481636014 0.658903644522 ... 577809 33
0.739301283105 0.138762751963 0.658922234764 ... 1590591 33
... ... ... ... ... ...
0.739389950758 0.139376220174 0.658693229028 ... 1590591 33
0.739099087292 0.140726588258 0.658732545516 ... 1590631 232
0.737999550267 0.140950272324 0.659916422388 ... 1590632 244
Quantity instances in the Units and Quantities (astropy.units) sub-package are now fully-fledged Numpy arrays, and common Numpy functions (such as numpy.mean, numpy.cos, numpy.log10, etc.) will now correctly treat the units:
>>> q = np.array([1., 2., 3., 4.]) * u.m / u.s
>>> np.mean(q)
<Quantity 2.5 m / s>
>>> np.std(q)
<Quantity 1.11803398875 m / s>
This includes functions that only accept specific units such as angles:
>>> q = 30. * u.deg
>>> np.sin(q)
<Quantity 0.5 >
or dimensionless quantities:
>>> nu = 3 * u.GHz
>>> T = 30 * u.K
>>> np.exp(- h * nu / (k_B * T))
<Quantity 0.995212254619 >
Note
Not all Numpy functions (in particular non-ufuncs) and functions outside Numpy will treat units correctly, so be aware that units may be implicitly dropped without a warning. Always check that the function you are using treats the units correctly.
Another change is that imperial units are not enabled by default. To enable them, use:
>>> from astropy.units import imperial
>>> imperial.enable()
Coordinate objects from the Astronomical Coordinate Systems (astropy.coordinates) sub-package can now store arrays of coordinates instead of just a single coordinate. This dramatically speeds up coordinate conversions when many coordinates are used. The following example shows how one can combine this with functionality from the Table class to read in arrays of coordinates and convert them to a different coordinate frame. First, we can read in a table which contains coordinates both in decimal and string form:
>>> from astropy.table import Table
>>> t = Table.read('2mass.tbl', format='ascii.ipac')
>>> print(t)
ra dec sra sdec ... h_k j_k
---------- ---------- ------------ ------------- ... ----- -----
274.429506 -13.870547 18h17m43.08s -13d52m13.97s ... 0.791 3.048
274.423821 -13.86974 18h17m41.72s -13d52m11.06s ... 0.867 3.034
274.424587 -13.739629 18h17m41.90s -13d44m22.66s ... 0.94 --
... ... ... ... ... ... ...
274.870009 -13.817775 18h19m28.80s -13d49m03.99s ... 1.557 --
274.735323 -13.941575 18h18m56.48s -13d56m29.67s ... -- --
274.866294 -13.841778 18h19m27.91s -13d50m30.40s ... 1.146 --
Then we can create the coordinate object either with the decimal floating-point values:
>>> from astropy import units as u
>>> from astropy import coordinates as coords
>>> c = coords.FK5(t['ra'], t['dec'], unit=(u.deg, u.deg))
>>> c[0]
<FK5 RA=274.42951 deg, Dec=-13.87055 deg>
>>> c[1]
<FK5 RA=274.42382 deg, Dec=-13.86974 deg>
or the string values:
>>> c = coords.FK5(t['sra'], t['sdec'], unit=(u.deg, u.deg))
>>> c[0]
<FK5 RA=274.42950 deg, Dec=-13.87055 deg>
>>> c[1]
<FK5 RA=274.42383 deg, Dec=-13.86974 deg>
Note that in the second case, the initialization will be slower due to the parsing of the strings. These coordinates can then easily be converted to other frames:
>>> cgal = c.transform_to(coords.Galactic)
>>> cgal[0]
<Galactic l=16.77345 deg, b=0.99446 deg>
>>> cgal[1]
<Galactic l=16.77155 deg, b=0.99968 deg>
For coordinate arrays, accessing attributes such as ra or dec will now return Numpy arrays.
As shown above, all the coordinate classes have now been renamed to drop the Coordinates suffix (e.g. ICRS instead of ICRSCoordinates). In addition, HorizontalCoordinates has now been renamed to AltAz.
Coordinate objects now support matching one set of coordinates to another using the array coordinates functionality described above. See match_to_catalog_sky and match_to_catalog_3d for more details.
Finally, coordinate objects now have a to_string method that allows easy conversion to string representations. For example, in the case of the previous coordinates used above:
>>> c.to_string()
[u'18h17m43.08s -13d52m13.97s',
u'18h17m41.72s -13d52m11.06s',
...
u'18h18m56.48s -13d56m29.67s',
u'18h19m27.91s -13d50m30.4s']
In addition to many bug fixes and usability improvements, the key new feature in the Data Tables (astropy.table) sub-package is the addition of high level Table operations that can be used to generate a new table from one or more input tables:
| Documentation | Description | Function |
|---|---|---|
| Grouped operations | Group tables and columns by keys | group_by |
| Stack vertically | Concatenate input tables along rows | vstack |
| Stack horizontally | Concatenate input tables along columns | hstack |
| Join | Database-style join of two tables | join |
Grouping is a useful concept that allows you to divide a table into sub-groups based on certain key values and create new tables based on computed properties of those sub-groups. As an example, if you have a table containing photometric observations of multiple sources over multiple epochs, it would be possible to compute a mean magnitude for each unique object. In addition to this aggregation operation, the grouping interface also allows filtering operations where certain groups are excluded from the resultant table.
Even more powerful is the ability to do database-style joins of tables. For instance, if you have distinct tables with photometry in different wavebands for a set of objects, you join these points into a single table with one row for each source.
The Time and Dates (astropy.time) sub-package has received attention in filling in the details from the initial release in astropy 0.2. This includes adding array indexing and supporting various arithmetic operations involving arrays, constants, and Quantity objects with time units. In addition the initial infrastructure was added to allow use of International Earth Rotation and Reference Systems Service tables so that automatic calculation of UT1 becomes possible.
One very significant improvement is an overhaul of the internal time manipulations so that arithmetic with Time and TimeDelta objects maintain sub-nanosecond precision over a time span longer than the age of the universe. This is done by carefully managing the way the time is represented and manipulated using two 64-bit floats.
Finally, three new time formats were added:
- datetime: standard library datetime.datetime objects.
- plot_date: dates compatible with the matplotlib.pyplot.plot_date function.
- gps: seconds since 1980-01-01 00:00:00 UTC including leap seconds.
The ASCII Tables (astropy.io.ascii) sub-package now includes functionality to write IPAC format tables.
The read() and write() functions now allow a format keyword argument for specifying the file format as a string. This replaces the deprecated Reader and Writer keywords which required supplying a fully-qualified class type. To convert existing code that uses Reader or Writer, change the class name to all lower case with underscores between words. For instance:
>>> from astropy.io import ascii
>>> data = [' name age ',
'----------- ----',
'Jane Doe 31 ',
'John Smith 45 ']
>>> t = ascii.read(data, Reader=ascii.FixedWidthTwoLine) # OLD
>>> t = ascii.read(data, format='fixed_width_two_line') # NEW
FITS format tables can now be read and written via the Unified file read/write interface. All of the ASCII table formats are now supported as well. When using the unified file interface for ASCII tables the format defined in the ASCII Tables (astropy.io.ascii) package is prefixed with 'ascii.'. Thus the previous example would be written:
>>> from astropy.table import Table
>>> t = Table.read(data, format='ascii.fixed_width_two_line')
Some formats such as cds or latex will work without the 'ascii.' prefix but this is deprecated and will be removed in the next major release.
The full list of available formats is now available via the get_formats function:
>>> from astropy.io import registry
>>> print registry.get_formats()
Data class Format Read Write Auto-identify Deprecated
---------- ------------ ---- ----- ------------- ----------
Table ascii Yes Yes No
Table ascii.aastex Yes Yes No
Table ascii.basic Yes Yes No
Table ascii.cds Yes No No
... ... ... ... ... ...
Table daophot Yes No No Yes
Table ipac Yes Yes No Yes
Table latex Yes Yes No Yes
Table rdb Yes Yes No Yes
If you make a mistake and specify an unavailable or incorrect format, the error message will now list all the available formats.
The convolution functionality that was originally included in the N-dimensional datasets (astropy.nddata) sub-package has now been moved to the new Convolution and filtering (astropy.convolution) sub-package. As part of a Google Summer of Code project it has been refactored to include a framework that provides common built-in kernels:
import numpy as np
from astropy.convolution import convolve, Gaussian2DKernel
# Generate data
np.random.seed(0)
image = np.random.random((128, 128))
# Create kernel
g = Gaussian2DKernel(width=1)
# Convolve data
image_new = convolve(image, g, boundary='extend')
# Plot the results
plt.figure(figsize=(8,3))
plt.subplot(1,2,1)
plt.imshow(image, interpolation='none', origin='lower', vmin=0., vmax=1.)
plt.title('Reference')
plt.subplot(1,2,2)
plt.imshow(image_new, interpolation='none', origin='lower', vmin=0., vmax=1.)
plt.title('Convolved')
(Source code, png, hires.png, pdf)
A number of different 1-D and 2-D kernels are provided, based on models defined in Models And Fitting (astropy.modeling). The discretization of the kernels can be handled in various ways (e.g. oversampling, interpolation, etc.) which are described in more detail in Convolution and filtering (astropy.convolution).
The Cosmological Calculations (astropy.cosmology) sub-package now includes support for including massive neutrinos in the cosmology classes, and the Planck 2013 cosmology has been updated to use this. In addition, Quantity objects are now used wherever appropriate:
>>> from astropy.cosmology import WMAP9
>>> WMAP9.H0
<Quantity 69.32 km / (Mpc s)>
>>> WMAP9.lookback_time(3)
<Quantity 11.590618401420071 Gyr>
>>> WMAP9.luminosity_distance(3)
<Quantity 26015.607762091513 Mpc>
The Astrostatistics Tools (astropy.stats) sub-package includes a number of new common statistical functions, for example related to binomial statistics and bootstrapping.
When reading FITS headers with the World Coordinate System (astropy.wcs) sub-package, warnings will now be displayed about any non-standard WCS keywords that were fixed to become standard compliant.
For users who have Scipy installed, the WCS class features a new method all_world2pix() for converting from world coordinates to pixel space including the inversion of astrometric distortion corrections.
The included version of wcslib has been upgraded to version 4.19. The relevant changes for astropy users are:
- Implemented the butterfly projection (XPH), being the polar form of the HEALPix projection with (H,K) = (4,3).
- Bug fix in celfix() when translating GLS to SFL with non-zero reference point.
- A number of memory handling and stability fixes.
The VOTable XML handling (astropy.io.votable) sub-package now includes support for the VOTable 1.3 proposed recommendation. Notably, this includes a new binary representation that supports masking of any data type.
The Astropy logger will now no longer log exceptions by default, and will also no longer log any warning emitted outside of Astropy. In addition, logging to the Astropy log file (located at ~/.astropy/config/astropy.log by default on MacOS X and Linux) has also been disabled by default. This functionality is automatically disabled for new users, but in order to see the new default behavior, previous users of Astropy will need to edit the Astropy configuration file (located at ~/.astropy/config/astropy.cfg by default on MaxOS X and Linux) and change the following two lines as follows:
# Whether to log exceptions before raising them
log_exceptions = False
# Whether to always log messages to a log file
log_to_file = False
For a full-list of deprecated features and backward-incompatible changes, please take a look at the full Full Changelog.
In Python 2.7 and above, deprecation warnings are disabled by default. If you want to make sure you see these warnings, you can run your Python scripts with:
$ python -Wd script.py
In addition to deprecation warnings, Astropy will also raise warnings (by default) about changes that are not backward-compatible. These can be disabled by doing:
import warnings
from astropy.utils.exceptions import AstropyBackwardsIncompatibleChangeWarning
warnings.simplefilter('ignore', AstropyBackwardsIncompatibleChangeWarning)


This document is the API specification for the Deep Java Library (DJL) Serving.
The DJL serving module is a standalone web service that can serve models with REST API. See here for more details.


Monster Generation
During this tutorial we’ll create our first monster, the lowly Kobold. We’ll also randomly create our Kobold and his friends in rooms across our map. At this point the Kobold will not act or even be able to be attacked. That will come later.
Choosing a Kobold Color
The most important part of creating our monster is choosing a color for him. I’m going to use an existing color from our swatch DbBrightWood
. Pick any color you want and add it to Colors.cs
.
public static RLColor KoboldColor = Swatch.DbBrightWood;
Create a Monster Base Class
Next we need to create the Monster
base class that all of our monsters going forward will inherit from. At this point it will be pretty lackluster and not have any functionality but we will be adding to it in the future. Our Monster
class is a type of Actor
so it needs to inherit from Actor
. Create a new class Monster.cs
in the Core
folder and add code that looks like the following:
public class Monster : Actor
{
// Empty for now, we will add functionality later
}
Creating a Kobold
Our first Monster
will be the Reptilian Kobold. Create a new folder called Monsters
and create a new class in the Monsters
folder called Kobold.cs
. The Kobold
class will inherit from the Monster
class that we made up above.
public class Kobold : Monster
{
public static Kobold Create( int level )
{
int health = Dice.Roll( "2D5" );
return new Kobold {
Attack = Dice.Roll( "1D3" ) + level / 3,
AttackChance = Dice.Roll( "25D3" ),
Awareness = 10,
Color = Colors.KoboldColor,
Defense = Dice.Roll( "1D3" ) + level / 3,
DefenseChance = Dice.Roll( "10D4" ),
Gold = Dice.Roll( "5D5" ),
Health = health,
MaxHealth = health,
Name = "Kobold",
Speed = 14,
Symbol = 'k'
};
}
}
For now the Kobold
will only have a Create()
method. We’ll pass the current level of the dungeon into the Create()
method so that as the player progresses deeper into the dungeon the Kobolds
will get stronger. Feel free to assign the stats to whatever you want. I used the Dice
class to roll for some random values.
One thing to note is that we didn’t create a Draw()
method for the Kobold
, yet he will still be able to be drawn to our map just fine. The reason for this is because of the inheritance chain we set up. Kobold : Monster : Actor
. Because an Actor
already has a Draw()
method the Kobold
will get it automatically through inheritance!
Adding Monsters to the DungeonMap
Now that we have our first monster we need a way to be able to add them to our DungeonMap
. Open DungeonMap.cs
and add a new private field that is a List<Monster>
. Make sure that you initialize the list in the constructor.
private readonly List<Monster> _monsters;
public DungeonMap()
{
// Initialize all the lists when we create a new DungeonMap
_monsters = new List<Monster>();
}
Next we’ll need to add a few new methods to DungeonMap.cs
to help us add monsters.
public void AddMonster( Monster monster )
{
_monsters.Add( monster );
// After adding the monster to the map make sure to make the cell not walkable
SetIsWalkable( monster.X, monster.Y, false );
}
// Look for a random location in the room that is walkable.
public Point GetRandomWalkableLocationInRoom( Rectangle room )
{
if ( DoesRoomHaveWalkableSpace( room ) )
{
for ( int i = 0; i < 100; i++ )
{
int x = Game.Random.Next( 1, room.Width - 2 ) + room.X;
int y = Game.Random.Next( 1, room.Height - 2 ) + room.Y;
if ( IsWalkable( x, y ) )
{
return new Point( x, y );
}
}
}
// If we didn't find a walkable location in the room return null
return null;
}
// Iterate through each Cell in the room and return true if any are walkable
public bool DoesRoomHaveWalkableSpace( Rectangle room )
{
for ( int x = 1; x <= room.Width - 2; x++ )
{
for ( int y = 1; y <= room.Height - 2; y++ )
{
if ( IsWalkable( x + room.X, y + room.Y ) )
{
return true;
}
}
}
return false;
}
The first method AddMonster()
will add a Monster
to list of monsters currently on the map and make sure that the Cell
the Monster
is located in will not be walkable.
The next two methods GetRandomWalkableLocationInRoom()
and DoesRoomHaveWalkableSpace()
will both be useful for us in determining a good location to place our Monsters
.
The last change to DungeonMap.cs will be to update the Draw()
method to make sure that all of the Monsters on the map are also drawn.
// Iterate through each monster on the map and draw it after drawing the Cells
foreach ( Monster monster in _monsters )
{
monster.Draw( mapConsole, this );
}
Generating and Placing Monsters
We now have the ability to add Monsters
to the DungeonMap
. The only thing left to do is to actually generate our Monsters
. We’ll update MapGenerator.cs
and add a method to PlaceMonsters()
.  If the result of the roll is 1-6 then we’ll roll 4-sided die and add that many monsters to the room in any open Cells
. We will make extensive use of the methods that we previously added to DungeonMap.cs
to help us out.
Add the following method to MapGenerator.cs
private void PlaceMonsters()
{
foreach ( var room in _map.Rooms )
{
// Each room has a 60% chance of having monsters
if ( Dice.Roll( "1D10" ) < 7 )
{
// Generate between 1 and 4 monsters
var numberOfMonsters = Dice.Roll( "1D4" );
for ( int i = 0; i < numberOfMonsters; i++ )
{
// Find a random walkable location in the room to place the monster
Point randomRoomLocation = _map.GetRandomWalkableLocationInRoom( room );
// It's possible that the room doesn't have space to place a monster
// In that case skip creating the monster
if ( randomRoomLocation != null )
{
// Temporarily hard code this monster to be created at level 1
var monster = Kobold.Create( 1 );
monster.X = randomRoomLocation.X;
monster.Y = randomRoomLocation.Y;
_map.AddMonster( monster );
}
}
}
}
}
Don’t forget to add a call to PlaceMonsters()
in the CreateMap()
method.
public DungeonMap CreateMap()
{
// ... Existing code
PlacePlayer();
// After the existing PlacePlayer() call, add another call to PlaceMonsters()
PlaceMonsters();
}
If you run the game now you should have some ‘k’ shaped kobolds on your map.  We will give them some interesting behaviors later on.
Code on GitHub
As always the code for the tutorial series so far can be found on GitHub:
Bored waiting for the next tutorial? The complete tutorial project is already finished and the source code is available on Github:
- Sample Roguelike game using RogueSharp and RLNet console
- Sample Roguelike game using RogueSharp and SadConsole


The Google Analytics Spreadsheet Add-on makes it easier for Google Analytics users to access, visualize, share, and manipulate their data in Google Spreadsheets. The add-on brings gives you the full power of the Google Analytics Core and Multi-Channel Funnels Reporting APIs without requiring you to know or write any code.
With this tool, you can:
To start using the Google Analytics Spreadsheet add-on you can simply download it from the Chrome Web Store and try adding it to one of your spreadsheets today.
If you have questions, check out the solution guide which explains how to install and use the add-on and goes over each option in detail.


estimate of "reasonable" noise in the data.
mean_std = np.mean(np.std(data[..., gtab.b0s_mask], -1))
This estimate is usually based on a small sample, and is thus a bit biased (for
import dipy.denoise.noise_estimate as ne
sigma = ne.estimate_sigma(data)
This estimate of the standard deviation will be used by the RESTORE algorithm
to identify the outliers in each voxel and is given as an input when


MARY SHELLEY'S FRANKENSTEIN A film review by Jeffrey Graebner Copyright 1994 Jeffrey Graebner
Sometimes, there can be a very thin line between overindulgence and brilliance. Kenneth Branagh's new film adaptation of MARY SHELLEY'S FRANKENSTEIN frequently straddles that line, occasionally ending up on both sides of it. Thankfully, the majority of the movie stays on the brilliant side.
Of course, Shelley's tale of Victor Frankenstein and his creation is one of the best known (and most often filmed) stories (the word "Frankenstein" even appears in the dictionary). Most past film versions have only stuck with Shelley's very basic premise, while making radical changes to the specifics. The screenplay to this film, by Steph Lady and Frank Darabont, goes back to the original novel for a much more faithful adaptation. There are certain changes made to accommodate the differences between the film and literature, but the film depicts a number of incidents from the novel that have not been present in other adaptations. It is also much more true to the *spirit* of the original story, particularly in its portrayal of the creature.
Unlike the best known adaptations of the past, the creature (played here by Robert DeNiro) is not a monosyllabic brute. Instead, he is given a great deal of intelligence and very deep emotion. The creature has significantly heightened strength, but his feelings are also equally enhanced. It is these emotions that make him dangerous, but they also make him quite human. This conflict, along with Victor's inability to truly understand what he has created, forms the heart of this film.
As in the original novel, the story is told in flashback as Victor (played by Branagh himself) recounts his tale to a ship captain (Aidan Quinn) who encounters him while obsessively searching for a water passage to the North Pole. We learn that, after his mother dies giving birth to his younger brother, Victor becomes so obsessed with death that he begins experimenting with ways to defeat it. In time, this obsession leads him to the actual desire to *create* life. While studying to become a doctor, Victor meets Professor Waldman (John Cleese, who is virtually unrecognizable) who has come very close to achieving this goal. After Waldman himself is killed, Victor takes over his work and creates the creature. After Victor becomes convinced that his creation is evil, he abandons it to die. Eventually, the creature learns to think, speak, and even read. He reads Victor's journals and returns seeking either vengeance, peace, or probably both.
The other key character in the story is Elizabeth (Helena Bonham Carter), the adoptive sister who eventually becomes Victor's love. The irony in this romance comes from the fact that Victor is so obsessed with defeating death that he fails to see that this woman is representative of real *life*. He is struggling to create life, when he already *has* it. There is one very pivotal sequence towards the end of the film which was not in Shelley's novel, but which manages to explore this aspect of the story in a very powerful and moving way. Even if it wasn't in the original novel, it is a wonderful extrapolation of one of the story's key ideas.
While the story of Frankenstein is unquestionably a horror story, it is important to distinguish between horror and being scary. Many of the events portrayed in this film are horrific, but they are *not* particularly scary. People going into the film expecting constant shocks and scares are likely to be disappointed.
 Both as a director and as an actor, Kenneth Branagh's classical theatrical background leads him to a style of heightened, almost indulgent emotion. Branagh very rarely plays anything small, but instead is virtually always playing scenes out to the hilt. The result is a film that is frantic and breathless, but also is full of powerful images and emotions.
Branagh's performance as Victor is one of constant motion. He shows the obsessive personality of the character by constantly running from place to place, often dripping in sweat and shouting his dialog. The performance is very theatrical and occasionally goes over-the-top, but it all really manages to fit the character. In many ways, we are able to actually *feel* Victor's obsession through Branagh's grandiose and passionate performance.
In contrast, DeNiro's performance is much quieter and more controlled. He is required to go from scenes of quiet tenderness to other scenes of pure rage. The real key to the character is that he feels these powerful emotions, but he was never taught how to control them. After Victor's abandonment, he was forced to mature on his own without any kind of moral guidance. The makeup effects do a good job at making DeNiro look frightening while still allowing him to do a great deal of acting with his facial expressions. DeNiro is often able to express a lot of emotion with very little dialog. It is another courageous and fascinating performance by one of the most daring actors of our time.
The real strength of this story is that neither Victor or his creation can be classified as either a hero or a villain. While this is a cautionary tale about the possible consequences of science, it leaves a lot of question about whether it is the actual *act* of creating a life that is immoral or if it is Victor's treatment of that life once the creation is finished. The film introduces the possibility that the story might have turned out differently if Victor had nurtured his creation instead of abandoning him.
As Elizabeth, Helena Bonham Carter is often required to serve as the voice of reason in the midst of all that is happening. She needs to provide a kind of moral touchstone for Victor. Unfortunately, this is one aspect of the film that doesn't quite work as well as it should. For one thing, she simply doesn't have enough scenes with Branagh. The movie could have used a little more time exploring the relationship between these two characters. There is nothing particularly wrong with Bonham Carter's performance but, with the exception of a few brief scenes, there really isn't a lot of chemistry developed between her and Branagh.
The film includes a strong supporting cast as well. Cleese gives a surprisingly effective, purely dramatic performance as Professor Waldman. Tom Hulce provides most of the film's comic relief as Henry, a college friend of Victor's. He is also the only other character (besides Victor and the creature) who is aware of Victor's experimentation, thus providing an occasional source for questioning dialog. Another very effective performance is given by Richard Briers as an elderly blind peasant who is the only person who is able to get past the creature's appearance and recognize his humanity. As the sea captain, Aidan Quinn's performance is probably the weakest in the film. Quinn makes the mistake of attempting an accent which comes and goes, but is never believable.
The production and set design as well as the cinematography in this film are all outstanding and very inventive. The actual creation sequence is one of the most breathtakingly exciting sequences placed on film in recent memory. Branagh's usual musical collaborator Patrick Doyle provides a dramatic score that occasionally threatens to become overbearing, but never quite overstays its welcome. The music contributes a great deal to the power of some of the key scenes.
This is a very visually oriented film and the dialog does occasionally seem a bit stilted. The story occasionally becomes pretty complicated and on occasion writers Lady and Darabont do give in to the temptation to overexplain things a bit. On a whole, though, the writing is strong and does a very good job at exploring the many interesting ideas in this story.
A lot of people are probably going to be turned off when they discover that MARY SHELLEY'S FRANKENSTEIN is not the type of movie they are expecting. It takes a very different approach from other past film versions of this story. Some may be turned off by the film's relative lack of scares while others may be bothered by the giddy excesses of Branagh's classically theatric style. On the other hand, though, I think others will, like me, be intrigued by the fascinating themes and ideas explored while also being seduced by the sheer emotion of the film. I feel that this is one of the most exciting cinematic experiences of 1994.
-- Jeffrey P. Graebner Columbus, Ohio
.
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


This voice application is created to call peoples without anyone seeing it.
It would be covered by 'HTTPS' - but i'm not sure about it. The adcvanced tech ppl
like gouverments will be able to listen in if the feel like it.
This voice app is not for secret use, and we as developer are not responsible
for any bad uses of this app.
-----------------------------
Peer ID:
-----------------------------
-----------------------------
To Generate an 'Peer ID' you need to click on
the 'answer' button.
(If an id don't show up, spam press the answer-button
or just refresh page with F5 or icon)


This is the nmbug bookmarklet.
To use it, just copy the link into your bookmarks, and start browsing Gmane. When you want to view or edit tags on the message you're viewing, click on the bookmarklet. It will pop up a dialog with the list of available tags with the currently selected tags highlighted:
Clicking on any tag will toggle its selection. For each tag
change, the bookmarklet will POST
to
the nmhive server,
which commits the change to its nmbug database.


Description:
Stores one byte indirect with or without displacement from a register to data space. For parts with SRAM, the data space consists of the register file, I/O memory and internal SRAM (and external SRAM if applicable). For parts without SRAM, the data space consists of the register file only. The EEPROM has a separate address space.
The data location is pointed to by the Z (16 bits) pointer register in the register file. Memory access is limited to the current data segment of 64K bytes. To access another data segment in devices with more than 64K bytes data space, the RAMPX, RAMPY, RAMPZ in register in the I/O area has to be changed.
The Z pointer register can either be left unchanged by the operation, or it can be post-incremented or pre-decremented. These features are especially suited for stack pointer usage of the Z pointer register, however because the Z pointer register can be used for indirect subroutine calls, indirect jumps and table lookup, it is often more convenient to use the X or Y pointer as a dedicated stack pointer. Note that only the low byte of the Z pointer is updated in devices with no more than 256 bytes data space. For such devices, the high byte of the pointer is not used by this instruction and can be used for other purposes. The RAMPZ register in the I/O area is updated in parts with more than 64K bytes data space or more than 64K bytes program memory, and the increment/decrement/displacement is added to the entire 24-bit address on such devices.
Not all variants of this instruction is available in all devices. Refer to the device specific instruction set summary.
The result of these combinations is undefined:
ST Z+, r30
ST Z+, r31
ST -Z, r30
ST -Z, r31
Using the Z pointer:
Operation: Comment:
(i) (Z) ←Rr Z: Unchanged
(ii) (Z) ← Rr Z ← Z+1 Z: Post incremented
(iii) Z ← Z - 1 (Z) ← Rr Z: Pre decremented
(iiii)* (Z+q) ← Rr Z: Unchanged, q: Displacement
Syntax: Operands: Program Counter:
(i) ST Z, Rr 0 ≤ r ≤ 31 PC ← PC + 1
(ii) ST Z+, Rr 0 ≤ r ≤ 31 PC ← PC + 1
(iii) ST -Z, Rr 0 ≤ r ≤ 31 PC ← PC + 1
(iiii)* STD Z+q, Rr 0 ≤ r ≤ 31, 0 ≤ q ≤ 63 PC ← PC + 1
Notes:
*)The displacement form of this instruction (LDD) is not available on AVR8L based devices.
16-bit Opcode :
|
(i) |
1000 |
001r |
rrrr |
0000 |
|---|---|---|---|---|
|
(ii) |
1001 |
001r |
rrrr |
0001 |
|
(iii) |
1001 |
001r |
rrrr |
0010 |
|
(iiii) |
10q0 |
qq1r |
rrrr |
0qqq |
Status Register (SREG) and Boolean Formula:
|
I |
T |
H |
S |
V |
N |
Z |
C |
|---|---|---|---|---|---|---|---|
|
- |
- |
- |
- |
- |
- |
- |
- |
Example:
clr r31 ; Clear Z high byte ldi r30,$60 ; Set Z low byte to $60 st Z+,r0 ; Store r0 in data space loc. $60(Z post inc) st Z,r1 ; Store r1 in data space loc. $61 ldi r30,$63 ; Set Z low byte to $63 st Z,r2 ; Store r2 in data space loc. $63 st -Z,r3 ; Store r3 in data space loc. $62(Z pre dec) std Z+2,r4 ; Store r4 in data space loc. $64
Words:1 (2 bytes)
Cycles:
|
Cycles |
Cycles xmega |
Cycles AVR8L | |
|---|---|---|---|
|
(i) |
2 |
1 |
1 |
|
(ii) |
2 |
1 |
1 |
|
(iii) |
2 |
2 |
2 |
|
(iiii) |
2 |
2 |
N/A |


Date - 2nd of January 2016
Date - 4th of January 2016
Recently I was testing a web application which was bit different then our normal web application. After spending some time on an engagement and understanding the whole application I got to know that application is using something called Java Web Forms.
This is exciting, I have never came across such type of application. It was the first time I have heard of this sort of an application. The challenge was to inspect the web application traffic through standard proxy (In my case I was using Burp).
Possible Vulnerablities:
Interesting facts during testing:
References:
http://www.oracle.com/technetwork/developer-tools/forms/overview/index.html
https://www.cvedetails.com/vulnerability-list/vendor_id-93/product_id-5102/Oracle-Forms.html


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF KERALA AT ERNAKULAM PRESENT: THE HONOURABLE MR.JUSTICE V.CHITAMBARESH MONDAY, THE 7TH DAY OF SEPTEMBER 2015/16TH BHADRA, 1937 WP(C).No. 26865 of 2015 (G) -------------------------------------- PETITIONER: --------------------- BINUKUMAR.P AGED 43 YEARS S/O. PARAMESWARAN NADAR, B.S. PALACE, MULLUVILA THEKKETHIL VENGANOOR P.O., THIRUVANANTHAPURAM BY ADVS.SRI.C.A.CHACKO SMT.C.M.CHARISMA SMT.MEGHA K.XAVIER RESPONDENTS: ---------------------------- 1. VENGANOOR GRAMA PANCHAYAT REPRESENTED BY SECRETARY, VENGANOOR THIRUVANANTHAPURAM - 695 523 2. THE SECRETARY, VENGANOOR GRAMA PANCHAYAT, VENGANOOR, THIRUVANANTHAPURAM - 695 523 3. KERALA STATE POLLUTION CONTROL BOARD, REPRESENTED BY ENVIRONMENTAL ENGINEER, DISTRICT OFFICE, PLAMOODU JUNCTION PATTOMP.O.,THIRUVANANTHAPURAM - 695 004 4. ANILKUMAR, S/O. SASIDHARAN, MEMBER OF WARD NO. 14 VENGANOOR GRAMA PANCHAYAT, RESIDING AT THEKKEVILAKATH MELE VEEDU VENGANOOR P.O.,THIRUVANANTHAPURAM - 695 523 5. SHEELA, AMARIVILAVEEDU, UCHAKKADA, VENGANOOR P.O.,THIRUVANANTHAPURAM - 695 523 6. SUNDARESAN, AMARIVILA, UCHAKKADA, VENGANOOR P.O.,THIRUVANANTHAPURAM - 695 523 R3 BY SRI.  NO. 35098/2014 P7- TRUE COPY OF PROCEEDINGS DATED 5.5.2015 OF THIRD RESPONDENT P8- TRUE COPY OF DECISION TAKEN BY COMMITTEE OF 1ST RESPONDENT ON 23.05.2015 P9- TRUE COPY OF JUDGMENT DATED 28.05.2015 IN W.A. NO. 829/2015 P10- TRUE COPY OF APPEAL NO. 561/2015 FILED BEFORE TRIBUNAL FOR LOCAL SELF GOVERNMENT INSTITUTIONS (THOUGH IT WASFILED AS REVISION PETITION, IT IS NUMBERED AS APPEAL) P11- TRUE COPY OF ORDER DATED 15.06.2015 IN APPEAL NO. 561/2015 P12- TRUE COPY OF NOTICE DATED 22.08.2015 ISSUED BY THE 2ND RESPONDENT P13- TRUE COPY OF JUDGMENT DATED 27.7.2015 IN CON. CASE (C) NO. 984/2015 P14- TRUE COPY OF COMMUNICATION DATED 28.07.2015 OF THIRD RESPONDENT P15- TRUE COPY OF SHOW CAUSE NOTICE DATED 22.08.2015 ISSUED BY THE THIRD RESPONDENT RESPONDENT(S)' EXHIBITS:-NIL --------------------------------------- /TRUE COPY/ P.A. TO JUDGE DCS V. CHITAMBARESH, J --------------------------------------- W.P.(C). NO. 26865 OF 2015 ---------------------------------------- Dated this the 7th day of September, 2015 JUDGMENT
The petitioner is aggrieved by Ext. P12 notice issued by the second respondent and Ext. P15 notice issued by the third respondent even while Ext. P10 appeal filed against Ext. P8 is pending consideration. Ext. P10 appeal has been filed before the Tribunal against Ext. P8 decision refusing to issue licence to conduct a pig farm.
2. It is open to the petitioner to apply for appropriate interim reliefs in Ext. P10 appeal even against Exts. P12 and P15 notices. Any motion made in that regard within two weeks from today shall be dealt with by the Tribunal by four weeks therefrom.
3. The petitioner is also permitted to independently challenge Ext. P15 notice before the appellate authority. An appeal lies under the Air (Prevention and Control of Pollution) Act, 1981.
The writ petition is disposed of.
V. CHITAMBARESH JUDGE DCS


About Me
I am Grace Mugwe, a fourth year student at Riara University and
a junior programer at Moringa Prep.
I have previously worked as a Social Media Manager in
two firms and then recently started my business.
I grow both fruits and vegetables at Lari, Kiambu County and
sell my produce to institutions and businesses in Kenya.
I love lions, tigers and rare wildlife and I appiciate their contribution to the eco-system.
I am also a student of life. Virtuous leader. Avid creative. Active volunteer.


Please log into JIRA
Sign In
View Toolbar
View issues
Log out
List of recently reported issues
ID
Name


somVista
Sign In
Email
Password
Register
Sign In
somVista
mic
exit_to_app
MP3
WAV
To begin, click the
mic
icon in the top right.
Press again to end your recording.
SomVista will output a SomVista Wave to your screen.
Customization and save options are shown below.
cloud_download
DL
delete_forever
Delete
save
Save
wallpaper
Load
Select New Background Color
mode_edit
Edit Name


decisions, rl
Contents
6.2. decisions, rl#
Some notes on decision theory based on Berkeley’s CS 188 course and “Artificial Intelligence” Russel & Norvig 3rd Edition
6.2.1. neuroscience#
Means–ends analysis - for planning subgoals, use the distance-to-the-goal as a continuous reward signal (and basically do greedy search with backtracking)
at test-time, we solve an optimization problem
6.2.2. game trees - R&N 5.2-5.5#
like search (adversarial search)
minimax algorithm
ply - half a move in a tree
for multiplayer, the backed-up value of a node n is the vector of the successor state with the highest value for the player choosing at n
time complexity - \(O(b^m)\)
space complexity - \(O(bm)\) or even \(O(m)\)
alpha-beta pruning cuts in half the exponential depth
once we have found out enough about n, we can prune it
depends on move-ordering
might want to explore best moves = killer moves first
transposition table can hash different movesets that are just transpositions of each other
imperfect real-time decisions
can evaluate nodes with a heuristic and cutoff before reaching goal
heuristic uses features
want quiescent search - consider if something dramatic will happen in the next ply
horizon effect - a position is bad but isn’t apparent for a few moves
singular extension - allow searching for certain specific moves that are always good at deeper depths
forward pruning - ignore some branches
beam search - consider only n best moves
PROBCUT prunes some more
search vs lookup
often just use lookup in the beginning
program can solve and just lookup endgames
stochastic games
include chance nodes
change minimax to expectiminimax
\(O(b^m numRolls^m)\)
cutoff evaluation function is sensitive to scaling - evaluation function must be a positive linear transformation of the probability of winning from a position
can do alpha-beta pruning analog if we assume evaluation function is bounded in some range
alternatively, could simulate games with Monte Carlo simulation
<IP_ADDRESS>. utilities / decision theory – R&N 16.1-16.3, mazzonni quant finance book#
lottery - any function of a random variable
utility function - lottery that satisfiers certain properties (e.g. transitivity)
expected utility = von Neumann-Morgenstern utility
goal: maximize utility by taking actions (focus on single actions)
utility function U(s) gives utility of a state
actions are probabilistic: \(P[RESULT(a)=s' \vert a,e]\)
s - state, e - observations, a - action
soln: pick action with maximum expected utility
expected utility \(EU(a\vert e) = \sum_{s'} P(RESULT(a)=s' \vert a,e) U(s')\)
notation
A>B - agent prefers A over B
A~B - agent is indifferent between A and B
preference relation has 6 axioms of utility theory
orderability - A>B, A~B, or A<B
transitivity
continuity
substitutability - can do algebra with preference eqns
monotonicity - if A>B then must prefer higher probability of A than B
decomposability - 2 consecutive lotteries can be compressed into single equivalent lottery
these axioms yield a utility function
isn’t unique (ex. affine transformation yields new utility function)
value function = ordinal utility function - sometimes ranking, numbers not needed
agent might not be explicitly maximizing the utility function
<IP_ADDRESS>. utility functions#
preference elicitation - finds utility function
normalized utility to have min and max value
assess utility of s by asking agent to choose between s and \((p: \min, (1-p): \max)\)
people have complicated utility functions
ex. micromort - one in a million chance of death
ex. QALY - quality-adjusted life year
risk
agents exhibits monotonic preference for more money
gambling has expected monetary value = EMV
risk averse = when utility of money is sublinear
risk premium = value agent will accept in lieu of lottery = certainty equivalent= insurance premium
risk-neutral = linear
risk-seeking = supralinear
absolute risk aversion \(ARA(x) = - \frac{u''(x)}{u'(x)} \) : higher is more risk averse
relative risk aversion \(ARA(x) = - \frac{x \cdot u''(x)}{u'(x)} \)
optimizer’s curse - tendency for E[utility] to be too high because we keep picking high utility randomness
normative theory - how idealized agents work
descriptive theory - how actual agents work
certainty effect - people are drawn to things that are certain
ambiguity aversion
framing effect - wording can influence people’s judgements
anchoring effect - buy middle-tier wine because expensive is there
6.2.3. decision theory / VPI – R&N 16.5 & 16.6#
note: here we are just making 1 decision
decision network (sometimes called influence diagram)
chance nodes - represent RVs (like BN)
decision nodes - points where decision maker has a choice of actions
utility nodes - represent agent’s utility function
can ignore chance nodes
then action-utility function = Q-function maps directly from actions to utility
evaluation
set evidence
for each possible value of decision node
set decision node to that value
calculate probabilities of parents of utility node
calculate resulting utility
return action with highest utility
<IP_ADDRESS>. the value of information#
information value theory - enables agent to choose what info to acquire
observations only affect agent’s belief state
value of info = difference in best expected value with/without info
maximum \(EU(\alpha|e) = \underset{a}{\max} \sum_{s'} P(Result(a)=s'|a, e) U(s')\)
value of perfect information VPI - assume we can obtain exact evidence for a variable (ex. variable \(T=t\))
\(VPI(T) = \mathbb{E}_{T}\left[ EU(\alpha|e, T) \right] - \underbrace{EU(\alpha \vert e)}_{\text{original EU}}\)
first term expands to \(\sum_t P(T=t \vert e) \cdot EU(\alpha \vert e, T=t) \)
within each of these EU, we take a max over actions
VPI not linearly additive, but is order-independent
intuition
info is more valuable when it is likely to cause a change of plan
info is more valuable when the new plan will be much better than the old plan
information-gathering agent
myopic - greedily obtain evidence which yields highest VPI until some threshold
conditional plan - considers more things
6.2.4. mdps and rl - R&N 17.1-17.4#
sequences of actions
fully observable - agent knows its state
markov decision process - all these things are given
set of states s
set of actions a
stochastic transition model \(P(s' \vert s,a)\)
reward function \(R(s)\)
utility aggregates rewards, for models more complex than mdps reward can be a function of past sequences of actions / observations
want policy \(\pi (s)\) - what action to do in state s
optimal policy yields highest expected utlity
optimizing MDP - multiattribute utility theory
could sum rewards, but results are infinite
instead define objective function (maps infinite sequences of rewards to single real numbers)
ex. discounting to prefer earlier rewards (most common)
discount reward n steps away by \(\gamma^n, 0<\gamma<1\)
ex. set a finite horizon and sum rewards
optimal action in a given state could change over time = nonstationary
ex. average reward rate per time step
ex. agent is guaranteed to get to terminal state eventually - proper policy
expected utility executing \(\pi\): \(U^\pi (s) = \mathbb E_{s_1,...,s_t}\left[\sum_t \gamma^t R(s_t)\right]\)
when we use discounted utilities, \(\pi\) is independent of starting state
\(\pi^*(s) = \underset{\pi}{\text{argmax}} \: U^\pi (s) = \underset{a}{\text{argmax}} \sum_{s'} P(s' \vert s,a) U(s')\)
experience replay - instead of learning from samples one by one, want to reduce correlation between subsequent samples
take a large batch of samples and sample randomly from it, rather than going sequentially
<IP_ADDRESS>. value iteration#
value iteration - calculates utility of each state and uses utilities to find optimal policy
bellman eqn: \(U(s) = R(s) + \gamma \: \underset{a}{\max} \sum_{s'} P(s' \vert s, a) U(s')\)
start with arbitrary utilities
recalculate several times with Bellman update to approximate solns to bellman eqn
value iteration eventually converges
contraction - function that brings variables together
contraction only has 1 fixed point
Bellman update is a contraction on the space of utility vectors and therefore converges
error is reduced by factor of \(\gamma\) each iteration
also, terminating condition: if \( \vert \vert U_{i+1}-U_i \vert \vert < \epsilon (1-\gamma) / \gamma\) then \( \vert \vert U_{i+1}-U \vert \vert <\epsilon\)
what actually matters is policy loss \( \vert \vert U^{\pi_i}-U \vert \vert \) - the most the agent can lose by executing \(\pi_i\) instead of the optimal policy \(\pi^*\)
if \( \vert \vert U_i -U \vert \vert < \epsilon\) then \( \vert \vert U^{\pi_i} - U \vert \vert < 2\epsilon \gamma / (1-\gamma)\)
<IP_ADDRESS>. policy iteration#
another way to find optimal policies
policy evaluation - given a policy \(\pi_i\), calculate \(U_i=U^{\pi_i}\), the utility of each state if \(\pi_i\) were to be executed
like value iteration, but with a set policy so there’s no max
\(U_i(s) = R(s) + \gamma \: \sum_{s'} P(s' \vert s, \pi_i(s)) U_i(s')\)
can solve exactly for small spaces, or approximate (set of lin. eqs.)
policy improvement - calculate a new MEU policy \(\pi_{i+1}\) using \(U_i\)
same as above, just \(\pi^*(s) = \underset{\pi}{\text{argmax}} \: U^\pi (s) = \underset{a}{\text{argmax}} \sum_{s'} P(s' \vert s,a) U'(s)\)
asynchronous policy iteration - don’t have to update all states at once
<IP_ADDRESS>. partially observable markov decision processes (POMDP)#
agent is not sure what state it’s in
same elements but add sensor model \(P(e \vert s)\)
have distr \(b(s)\) for belief states
updates like the HMM: \(b'(s') = \alpha P(e \vert s') \sum_s P(s' \vert s, a) b(s)\)
changes based on observations
optimal action depends only on the agent’s current belief state
use belief states as the states of an MDP and solve as before
changes because state space is now continuous
value iteration
expected utility of executing p in belief state is just \(b \cdot \alpha_p\) (dot product)
\(U(b) = U^{\pi^*}(b)=\underset{p}{\max} \: b \cdot \alpha_p\)
belief space is continuous [0, 1] so we represent it as piecewise linear, and store these discrete lines in memory
do this by iterating and keeping any values that are optimal at some point
remove dominated plans
generally this is far too inefficient
dynamic decision network - online agent
6.2.5. reinforcement learning – R&N 21.1-21.6#
reinforcement learning - use observed rewards to learn optimal policy for the environment
in ch 17, agent had model of environment (\(P(s'|s, a)\) and \(R(s)\))
2 problems
passive - given \(\pi\), learn \(U^\pi (s)\)
active - explore states to find utilities and exploit to get highest reward
2 model types, 3 agent designs
model-based: can predict next state/reward before taking action (for MDP, requires learning \(P(s'|s,a)\))
utility-based agent - learns \(U(S)\) - utility function on states
requires model of the environment
model-free
Q-learning agent: learns \(Q(s, a)\) - action-utility function = Q-function maps actions \(\to\) utility
reflex agent: learns \(Q(s)\) - policy that maps directly from states to actions
<IP_ADDRESS>. passive reinforcement learning (estimate value function given policy)#
given policy \(\pi\), learn \(U^\pi (s) = \mathbb E\left[ \sum_{t=0}^{\infty} \gamma^t R(S_t)\right]\)
like policy evaluation, but transition model / reward function are unknown
direct utility estimation: treat states independently
run trials to sample utility
average to get expected total reward for each state = expected total reward from each state
adaptive dynamic programming (ADP) - 2 steps
sample to estimate transition model \(P(s'|s, a)\) and rewards \(R(s)\)
find \(U^\pi(s)\) with the Bellman eqn (plug in at each step)
we might want to enforce a prior on the model (two ways)
Bayesian reinforcement learning - assume a prior \(P(h)\) on transition model h
use prior to calculate \(P(h \vert e)\)
use \(P(h|e)\) to calculate optimal policy: \(\pi^* = \underset{\pi}{argmax} \sum_h P(h \vert e) u_h^\pi\)
\(u_h^\pi\)= expected utility over all possible start states, obtained by executing policy \(\pi\) in model h
robust control theory - give best outcome in the worst case over H
\(\pi^* = \underset{\pi}{argmax}\: \underset{h}{\min} \: u_h^\pi\)
temporal-difference learning - adjust utility estimates towards local equilibrium for correct utilities
like an approximation of ADP
when we transition \(s \to s'\), update \(U^\pi(s) = U^\pi (s) + \alpha \left[R(s) - U^\pi (s) + \gamma \:U^\pi (s') \right]\)
\(\alpha\) should decrease over time to converge
prioritized sweeping - prefer adjustments to states whose likely successors have just undergone a large adjustment in their own utility estimates
speeds things up
<IP_ADDRESS>. active reinforcement learning#
no longer following set policy
explore states to find their utilities and exploit model to get highest reward
must explore all actions, not just those in the policy
bandit problems - determining exploration policy
n-armed bandit - pulling n levelers on a slot machine, each with different distr.
Gittins index - function of number of pulls / payoff
coorect schemes should be GLIE - greedy in the limit of infinite exploration - visits all states infinitely, but eventually become greedy
<IP_ADDRESS>.1. agent examples#
ex. choose random action \(1/t\) of the time
ex. active adp agent
give optimistic utility to relatively unexplored states
uses exploration function f(u, numTimesVisited) around the sum in the bellman eqn
high utilities will propagate
ex. active TD agent
now must learn transitions (same as adp)
update rule same as passive TD
<IP_ADDRESS>.2. learning action-utility function \(Q(s, a)\)#
\(U(s) = \underset{a}{\max} \: Q(s,a)\)
ADP version: \(Q(s, a) = R(s) + \gamma \sum_{s'} P(s'|s, a) \underset{a'}{\max} Q(s', a')\)
TD version: \(Q(s,a) = Q(s,a) + \alpha [R(s) - Q(s,a) + \gamma \: \underset{a'}{\max} Q(s', a')]\) - this is what is usually referred to as Q-learning
this is off-policy (only uses best Q-value, doesn’t pay attention to actualy policy being followed) - more flexible
SARSA (state-action-reward-state-action) is related: \(Q(s,a) = Q(s,a) + \alpha [R(s) + \gamma \: Q(s', a') - Q(s,a) ]\)
here, \(a'\) is action actually taken
SARSA is on-policy (pays attention to actual policy being followed)
can approximate Q-function with something other than a lookup table
ex. linear function of parameters \(\hat{U}_\theta(s) = \theta_1f_1(s) + ... + \theta_n f_n(s)\)
can learn params online with delta rule = wildrow-hoff rule: \(\theta_i = \theta - \alpha \: \frac{\partial Loss}{\partial \theta_i}\)
<IP_ADDRESS>. policy search#
keep twiddling the policy as long as it improves, then stop
store one Q-function (parameterized by \(\theta\)) for each action
ex. \(\pi(s) = \underset{a}{\max} \: \hat{Q}_\theta (s,a)\)
this is discontinunous, instead often use stochastic policy representation (ex. softmax for \(\pi_\theta (s,a)\))
learn \(\theta\) that results in good performance
Q-learning learns actual Q* function - could be different (scaling factor etc.)
to find \(\pi\) maximize policy value \(p(\theta) = \) expected reward executing \(\pi_\theta\)
could do this with sgd using policy gradient
when environment/policy is stochastic, more difficult
could sample mutiple times to compute gradient
REINFORCE algorithm - could approximate gradient at \(\theta\) by just sampling at \(\theta\): \(\nabla_\theta p(\theta) \approx \frac{1}{N} \sum_{j=1}^N \frac{(\nabla_\theta \pi_\theta (s, a_j)) R_j (s)}{\pi_\theta (s, a_j)}\)
PEGASUS - correlated sampling - ex. 2 blackjack programs would both be dealt same hands - want to see different policies on same things
6.2.6. deep rl course#
<IP_ADDRESS>. “supervised rl” (imitation learning)#
imitation learning / behavioral cloning – given pairs of observations / actions, learn policy to take action given observation \(\pi_\theta(a_t|o_t)\)
basic example: cost function is 0 when action is same as human’s in data and 1 otherwise
usually inefficient / insufficient
one improvement: DAgger (ross et al. 2011) - use learned policy to generate synthetic observations and have humans label those
we can query observations when deviate slightly from expert trajectory
goal-conditioned behavioral cloning - subdivides data based on different goals - learn \(\pi_\theta(a|s, g)\)
example - given a goal location, take actions to move a robot there
Learning to Reach Goals via Iterated Supervised Learning (ghosh … levine, 2020)
move robot arm based on policy (initially random)
see which random goals are met
use this as goal-conditioned behavioral cloning
update policy and repeat
<IP_ADDRESS>. rl algorithms overview#
3 general steps (iterated)
fit a model / estimate the return
improve the policy
generate samples (i.e. run the policy)
\(\theta^{\star}=\arg \max _{\theta} E_{\tau \sim p_{\theta}(\tau)}\left[\sum_{t} r\left(\mathbf{s}_{t}, \mathbf{a}_{t}\right)\right]\)
Value-based: estimate value function or \(Q\)-function of the optimal policy (no explicit policy)
Policy gradients: directly differentiate the above objective
policy network \(\pi_\theta(a|s)\)
gradients are extremely noisy compared to supervised learning
Actor-critic: estimate value function or Q-function of the current policy (critic), use it to improve policy (actor)
Model-based RL: estimate the transition model, and then…
just use the model to plan (no plicy)
trajectory optimization/optimal control (continuous space) - optimize over actions
discrete planning - e.g. monte carlo tree search
backpropagate gradients into the policy
use the model to learn a value function
fit model / estimate return |
improve policy |
|
|---|---|---|
value-based |
fit \(V(s)\) or \(Q(s, a)\) |
\(\pi(s) = \text{argmax}_a Q(s, a)\) |
(direct) policy gradients |
evaluate returns \(R_\tau = \sum_t r(s_t, a_t)\) |
\(\theta = \theta + \alpha \nabla_\theta E[\sum_t r(s_t, a_t)]\) |
actor-critic |
fit \(V(s)\) or \(Q(s, a)\) |
\(\theta = \theta + \alpha \nabla_\theta E[Q(s, a)]\) |
model-based |
maybe model $P(s’ |
s, a)$ |
sample efficiency
on policy - must generate new samples each time the policy is changed
off policy - can improve policy without generating new samples from it (so look at a bunch of samples then update)
offline rl - data collected only once with any policy, then want to learn good policy from that
<IP_ADDRESS>. other problems#
<IP_ADDRESS>.1. inverse rl#
Inverse RL - learning reward functions from example
ai should be uncertain about utitilies
utilties should be inferred from human preferences
in systems that interact, need to express preferences in terms of game theory
can solve it with a GAN: e.g. A Connection between Generative Adversarial Networks, Inverse Reinforcement Learning, and Energy-Based Models (finn et al. 2016)
Apprenticeship learning via inverse reinforcement learning | Proceedings of the twenty-first international conference on Machine learning (abbeel & ng, 2004) - good intro to inverse RL
<IP_ADDRESS>.2. planning#
Efficient Learning in Cellular Simultaneous Recurrent Neural Networks - The Case of Maze Navigation Problem (ilin et al. 2007) - explored connections between planning algorithms and recurrent NNs
Value Iteration Networks (tamar…levine, & abbeel, 2017)
represent value iteration as a fully differentiable DNN using recurrence
<IP_ADDRESS>.3. metalearning#
learning to learn (very close to multi-task learning)
e.g. learn optimizer, representation
e.g. learn how to explore
e.g. learn how to do RL for various different walking tasks and then generalize to new walking task with few samples
Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks (finn, levine, & abbeel, 2017) - treat metalearner itself as an RL algorithm
multitask learning
sometimes have the ability to decide which new tasks to add (e.g. by changing simulator)
<IP_ADDRESS>.4. offline rl#
core issue with offline RL: want policy that improves over the training policy, but can’t deviate from the training policy due to distr. shift
one idea: instead of collecting new samples with policy, reweight samples using importance sampling based on policy
IQL: Implicit Q-learning (ashvin’s paper, 2021)
IQL - foregoes need to evaluate unseen actions


SecuritySquad is a group of three Software Engineering Students on the Baden-Württemberg Cooperative State University (DHBW) in Karlsruhe.
Our main project is webifier, which is a security application to test certain websites for malicious code.
webifier is a web security application that let's you check websites for malicious behaviour and display the results graphically.


TCGBAuthAdapterDelegate Protocol Reference
| Conforms to | NSObject |
|---|---|
| Declared in | TCGBAuthAdapterDelegate.h |
Overview
The protocol TCGBAuthAdapterDelegate is for developing Auth Adapter.
This protocol contains several methods such as to login, logout and so on.
Initilaize Auth Adapter
– initializeWithOptions:
This method ininialize the Auth Adapter class.
- (void)initializeWithOptions:(NSDictionary *)options
Parameters
options |
isDebugMode is for setting debug mode of ToastCloud IAP module. |
|---|
Declared In
TCGBAuthAdapterDelegate.h
Authentication API
– loginWithSender:target:additionalInfo:viewController:completion:
required method
Login to identity service provider.
- (void)loginWithSender:(id)sender target:(id<TCGBAuthAdapterDelegate>)target additionalInfo:(NSDictionary *)additionalInfo viewController:(UIViewController *)viewController completion:(void ( ^ ) ( id credential , TCGBError *error ))completion
Parameters
sender |
sender instance |
|---|---|
target |
target instance |
additionalInfo |
If identity provider needs to set something when it is initialized, this additionanlInfo is set. |
viewController |
presenting view controller |
completion |
completion handler when auth process(login, logout, withdraw) is completed. |
Declared In
TCGBAuthAdapterDelegate.h
– logoutWithSender:target:completion:
required method
Logout to identity service provider.
- (void)logoutWithSender:(id)sender target:(id<TCGBAuthAdapterDelegate>)target completion:(void ( ^ ) ( TCGBError *error ))completion
Parameters
sender |
sender instance |
|---|---|
target |
target instance |
completion |
completion handler when auth process(login, logout, withdraw) is completed. |
Declared In
TCGBAuthAdapterDelegate.h
– withdrawWithSender:target:completion:
required method
Withdrwal to identity service provider.
- (void)withdrawWithSender:(id)sender target:(id<TCGBAuthAdapterDelegate>)target completion:(void ( ^ ) ( TCGBError *error ))completion
Parameters
sender |
sender instance |
|---|---|
target |
target instance |
completion |
completion handler when auth process(login, logout, withdraw) is completed. |
Declared In
TCGBAuthAdapterDelegate.h
– addMappingWithSender:target:additionalInfo:viewController:completion:
Mapping to identity service provider.
- (void)addMappingWithSender:(id)sender target:(id<TCGBAuthAdapterDelegate>)target additionalInfo:(NSDictionary *)additionalInfo viewController:(UIViewController *)viewController completion:(void ( ^ ) ( id credential , TCGBError *error ))completion
Parameters
sender |
sender instance |
|---|---|
target |
target instance |
additionalInfo |
If identity provider needs to set something when it is initialized, this additionanlInfo is set. |
completion |
completion handler when auth process(login, logout, withdraw) is completed. |
Declared In
TCGBAuthAdapterDelegate.h
Provider information
– authInfosFromProvider
Provider’s authenticated credential
- (TCGBProviderAuthCredential *)authInfosFromProvider
Return Value
Provider’s authenticated credential
Declared In
TCGBAuthAdapterDelegate.h
– providerName
Provider’s name
- (NSString *)providerName
Return Value
Provider’s name
Declared In
TCGBAuthAdapterDelegate.h
Adapter information
+ versionString
required method
semantic version string of Auth Adapter
+ (NSString *)versionString
Return Value
semantic version string of Auth Adapter
Declared In
TCGBAuthAdapterDelegate.h
Application life cycle for identify provider's sdk setting
– application:willFinishLaunchingWithOptions:
Managing State Transitions
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Declared In
TCGBAuthAdapterDelegate.h
– application:didReceiveRemoteNotification:fetchCompletionHandler:
Responding to Notifications and Events
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult result ))completionHandler
Declared In
TCGBAuthAdapterDelegate.h
– application:openURL:options:
handle OpenURL
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
Declared In
TCGBAuthAdapterDelegate.h