Joint work with Earl T. Barr, Marc Brockschmidt, Santanu Dash, - - PowerPoint PPT Presentation

joint work with earl t barr marc
SMART_READER_LITE
LIVE PREVIEW

Joint work with Earl T. Barr, Marc Brockschmidt, Santanu Dash, - - PowerPoint PPT Presentation

Microsoft Research Cambridge Joint work with Earl T. Barr, Marc Brockschmidt, Santanu Dash, Mahmoud Khademi Deep Understands images/language/speech Learning Finds patterns in noisy data Requires many samples - Handling structured


slide-1
SLIDE 1

Microsoft Research Cambridge

Joint work with Earl T. Barr, Marc Brockschmidt, Santanu Dash, Mahmoud Khademi

slide-2
SLIDE 2

Program Structure Deep Learning

✓ Understands images/language/speech ✓ Finds patterns in noisy data

  • Requires many samples
  • Handling structured data is hard

✓ Interpretable ✓ Generalisation verifiable

  • Manual effort
  • Limited to specialists

DPU

slide-3
SLIDE 3
slide-4
SLIDE 4

Machine Learning (ML) component → Artificial Intelligence (AI) Tool

slide-5
SLIDE 5

Research in ML4Code

slide-6
SLIDE 6
slide-7
SLIDE 7

https://visualstudio.microsoft.com/services/intellicode/ http://www.eclipse.org/recommenders/

slide-8
SLIDE 8

public class TextRunnerTest extends TestCase { void execTest(String testClass, boolean success) throws Exception { ... InputStream i = p.getInputStream(); while ((i.read()) != -1); ... } ... } Suggested Name input (81.9%)

slide-9
SLIDE 9
slide-10
SLIDE 10

http://jsnice.org/

Deep Learning Type Inference

  • V. Hellendoorn, C. Bird, E.T. Barr, M. Allamanis. 2018

Predicting Program Properties from Code

  • V. Raychev, M. Vechev, A. Krause. 2015
slide-11
SLIDE 11
slide-12
SLIDE 12

Variable Misuse

Allamanis et al. “Learning to Represent Programs with Graphs”. 2018

slide-13
SLIDE 13

Defined Types

string string

slide-14
SLIDE 14

Allamanis, Brockschmidt, Khademi. ICLR 2018

slide-15
SLIDE 15

int int int int return for (int i =0; < ; ++) if ( [ ]>0) += [ ]; int int int int return for (int i = 0; i < lim; i++) if (arr[i] > 0) sum += arr[i];

slide-16
SLIDE 16

Assert.NotNull(clazz);

Assert . ( NotNull … ExpressionStatement InvocationExpression MemberAccessExpression ArgumentList Next Token AST Child

slide-17
SLIDE 17

(x, y) = Foo(); while (x > 0) x = x + y;

Last Write Last Use Computed From

slide-18
SLIDE 18

int int int int return for (int i =0; < ; ++) if ( [ ]>0) += [ ]; ~900 nodes/graph ~8k edges/graph

slide-19
SLIDE 19

B A E G D C F

Li et al (2015). Gated Graph Sequence Neural Networks.

B A E G D C F Gilmer et al (2017). Neural Message Passing for Quantum Chemistry.

slide-20
SLIDE 20

F D E

E F D F

F

slide-21
SLIDE 21

F F D E

E F D F

Li et al (2015). Gated graph sequence neural networks.

slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24

Li et al (2015). Gated Graph Sequence Neural Networks. Gilmer et al (2017). Neural Message Passing for Quantum Chemistry.

  • node selection
  • node classification
  • graph classification

https://github.com/Microsoft/gated-graph-neural-network-samples

slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27

B A E G D C F

slide-28
SLIDE 28

B A E G D C F

slide-29
SLIDE 29
slide-30
SLIDE 30

Seen Projects: 24 F/OSS C# projects (2060 kLOC): Used for train and test 3.8 type-correct alternative variables per slot (median 3, σ= 2.6)

Accuracy (%) BiGRU BiGRU+Dataflow GGNN Seen Projects 50.0 73.7 85.5

slide-31
SLIDE 31

Accuracy (%) BiGRU BiGRU+Dataflow GGNN Seen Projects 50.0 73.7 85.5 Unseen Projects 28.9 60.2 78.2

Seen Projects: 24 F/OSS C# projects (2060 kLOC): Used for train and test Unseen Projects: 3 F/OSS C# projects (228 kLOC): Used only for test 3.8 type-correct alternative variables per slot (median 3, σ= 2.6)

slide-32
SLIDE 32
slide-33
SLIDE 33

Dash, Allamanis, Barr. FSE 2018

slide-34
SLIDE 34

def addToCart(productId, providerId, cartId) username := password temperature + numOfOranges

slide-35
SLIDE 35

Defined Types

string string

slide-36
SLIDE 36

string EncryptAndSignCookie(string cookieValue, FormsAuthenticationConfiguration config) { string encryptedCookie = config.CryptographyConfiguration.EncryptionProvider.Encrypt(cookieValue); var hmacBytes = GenerateHmac(encryptedCookie, config); string hmacString = Convert.ToBase64String(hmacBytes); return hmacString + encryptedCookie; }

slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39

def return

slide-40
SLIDE 40
slide-41
SLIDE 41

def string

slide-42
SLIDE 42

def def string

slide-43
SLIDE 43
slide-44
SLIDE 44
slide-45
SLIDE 45
slide-46
SLIDE 46
slide-47
SLIDE 47
slide-48
SLIDE 48
slide-49
SLIDE 49
slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53
slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57
slide-58
SLIDE 58
slide-59
SLIDE 59

Full name of node or constant value in bepuphysics damping, SuspensionDamping, starchDamping, dampingConstant, angularDamping, LinearDamping currentDistance, distance3, candidateDistance, pointDistance, distanceFromMaximum, grabDistance, VariableLinearSpeedCurve::GetDistance, tempDistance goalVelocity, driveSpeed, GoalSpeed minRadius, MinimumRadius, Radius, minimumRadiusA, WrappedShape::ComputeMinimumRadius, topRadius, MaximumRadius, graphicalRadius, TransformableShape::ComputeMaximumRadius blendedCoefficient, KineticFriction, dynamicCoefficient,KineticBreakingFrictionCoefficient angle, myMaximumAngle, MinimumAngle, currentAngle, MaximumAngle, steeringAngle, MathHelper::WrapAngle targetHeight, Height, ProneHeight, crouchingHeight, standingHeight Mass, effectiveMass, newMassA, newMass M22, m11, M44, resultM44, M43, intermediate, m31, X, Y, Z

slide-60
SLIDE 60
slide-61
SLIDE 61

UI/UX ML Capabilities Metrics Low resources

slide-62
SLIDE 62

Learning Signals

target prediction 𝑔

𝜄(𝑦)

input data 𝑦

model of problem

  • Given dataset

𝑦1, 𝑧1 , … , 𝑦𝑂, 𝑧𝑂

  • Minimize Loss ℒ 𝜄 =

1 𝑂 σ𝑗 𝑀 𝑔 𝜄 𝑦𝑗 , 𝑧𝑗

slide-63
SLIDE 63

Slides at: http://web.cs.ucdavis.edu/~su/SteeleSplash2016.pdf

slide-64
SLIDE 64

Deep Program Understanding Cambridge, UK

Learning from Human Aspects of Code Reasoning over Rich Structures

Towards Learned Program Analyses with Machine Learning

miltos1 https://miltos.allamanis.com