Code Monkey home page Code Monkey logo

sti's Introduction

sti

sti is an investigation into the feasibility of using deep neural networks for local planning problems in well trajectory engineering. As such, all of the code is currently experimental, and not intended for use in production.

The problem of interest is as follows:

Given start and end states as (north, east, tvd, inc, azi) and a dog leg severity limitation, find the shortest possible trajectory from start to end state obeying the dog leg severity limitation.

An efficient solution to this problem can be used in a global planner, such as RRT/RRT*.

sti approximates an optimal solution to this problem by using a deep neural network trained on sample solutions to the problem from numerical optimization.

The name sti comes from the Norwegian word "sti", which translates into "trail" or "path" in English."

Key ideas

sti makes an Ansatz that an optimal extension to 3D of Dubin's path is also three segments. Internally, sti works by finding two intermediate points that when tied together is an optimal path from the start to the target state.

Parametrization

In the current codebase, the two points are (north, east, tvd) triplets, tied together by using the dogleg toolface method, producing either straight lines or circular arcs.

When connecting the points, dogleg toolface parameters are selected such that arrival at the target position is guaranteed, while azimuth, inclination and dog leg severity may be violated.

Abandonded approaches to parametrization of intermediate points are:

  • Intermediate points as (inc, azi), tied together using minimum curvature. Abandonded due to problem with non-uniqueness of projection method, many local minima in optimization when producing training data and no arrival guarantee.
  • Intermediate points as (toolface angle, dls, md step). Terrible performance in optimization when producing training data due to toolface angle and dls neutralizing each other when 0 or less. Also no arrival guarantee.

Standardized problem

To achive maximum sample efficiency in the training data, the dimensionality of the problem is reduced by transforming it to standardized format. This is done by:

  • Translating the co-ordinate system so that the start position is always at (0,0,0).
  • Rotating the co-ordinate system so that
    • Start inclination and azimuth is (0,0), i.e. straight down. This is done by using the bit direction as the tvd direction unit vector in the rotation.
    • The target location is always in the north-tvd plane with positive north value. This is done by orthoganalizing & normalizing the vector difference from start to target location wrt. the tvd as defined above, and let this be the north direction unit vector in the rotation.
    • The east direction is then defined by their cross product, and a check for positive dot product with the target bit direction, enforcing a target azimuth in [0, pi]. Note: This convention produces both left & right handed systems. In the preliminary results, it appears that the approach taken to calculate the optimal path is not sensitive to this - but more testing should be done.

Producing training data

To produce data training data for a deep neural network, the local planning problem is solved repeatedly using numerical optimization with randomized input. To achive maximum sample efficiency, the standardized problem is sampled.

To speed up the process, a preliminary neural net is used as an initial guess for the optimization algorithm.

See scripts/create_training_data.py for a draft procedure for producing training data.

The training data can be boosted by inverting the problem so that start and target are flipped. Note that their directions must also be changed. See scripts/reverse_training_data.py for a preliminary sketch.

Note: The data is no longer i.i.d when using this approach. Hence, special care should be taken when testing models trained on boosted data. This is not implemented in the preliminary pipeline.

Training a neural network model

  • See scripts/mlp_model.py for a preliminary training pipeline.
  • Sample data available in data/merged, currently about 8 million solved problems are available for model fitting.
  • A holdout dataset for model evaluation is also available in the same folder.

Results

Shown below is a MLP with 7 hidden layers trained on 1 million data points, agumented with reversed training data.

The model achives an R^2 of 0.75 and a MSE of 268 on the training data (not corrected for non-i.i.d). Below the model is scored on the holdout dataset (i.i.d).

Edit: Some later attempts with more data and deeper networks pushed the R^2 to about 0.9.

Residuals

API

The code base is currently at an experimental stage - thus no API is provided. No stability of method names and signatures should be assumed.

Contributing

You're welcome. Add issues, make PRs.

License

LGPL-3

sti's People

Contributors

jgvabo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sky370

sti's Issues

Update setup.py

Add license, author, url. Pin scipy until tested for more versions.

Create containers for common data types

The state, position, directions, dogleg toolface parameters etc. were intentionally implemented using numpy arrays in hope to get performance boost from JAX autograd. Autograd has been abandoned, and these data types should be wrapped for safety.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.