Microsoft Research, Cambridge Joint work with Marc Brockschmidt, - - PowerPoint PPT Presentation

microsoft research cambridge
SMART_READER_LITE
LIVE PREVIEW

Microsoft Research, Cambridge Joint work with Marc Brockschmidt, - - PowerPoint PPT Presentation

Microsoft Research, Cambridge Joint work with Marc Brockschmidt, Mahmoud Khademi, Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Santanu Dash, Earl T. Barr Deep Understands images/language/speech Learning Finds patterns in noisy data


slide-1
SLIDE 1

Microsoft Research, Cambridge

Joint work with Marc Brockschmidt, Mahmoud Khademi, Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Santanu Dash, Earl T. Barr

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

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

slide-5
SLIDE 5
slide-6
SLIDE 6

Research in ML+Code

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10

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-11
SLIDE 11

Assert.NotNull(clazz);

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

slide-12
SLIDE 12

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

Last Write Last Use Computed From

slide-13
SLIDE 13

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

slide-14
SLIDE 14

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-15
SLIDE 15

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/tf-gnn-samples/

slide-16
SLIDE 16
slide-17
SLIDE 17

B A E G D C F

slide-18
SLIDE 18

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-19
SLIDE 19

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-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23

let a = 1 ; let b = a + 1 ;

slide-24
SLIDE 24

CheckJS

(classic typechecker)

Type Annotations

(but contain any’s that can be refined)

DeepTyper

predict on all >90% confidence

“Augmented” Type Annotations

Hellendoorn, Barr, Bird, Allamanis, FSE 2018

slide-25
SLIDE 25

Defined Types

string string

slide-26
SLIDE 26

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; }

Dash, Allamanis, Barr. 2018

slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29

def return

slide-30
SLIDE 30
slide-31
SLIDE 31

def string

slide-32
SLIDE 32

def def string

slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37
slide-38
SLIDE 38
slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41

Full ll name me of node e or constant stant value lue in bepuphysi uphysics cs 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-42
SLIDE 42
slide-43
SLIDE 43

https://github.com/github/CodeSearchNet

slide-44
SLIDE 44
slide-45
SLIDE 45

Learn Patterns from Rich Structure Reasoning

Formal Methods

Photo by Luke Stackpoole

Machine Learning

slide-46
SLIDE 46
slide-47
SLIDE 47
slide-48
SLIDE 48

F D E

E F D F

F

slide-49
SLIDE 49

B A E G D C F

slide-50
SLIDE 50
slide-51
SLIDE 51