[Edinburgh-pm] Deep-learning Perl

Miles Gould miles at assyrian.org.uk
Fri Jul 21 04:06:00 PDT 2017


Hi everyone!

You may have seen http://lewisandquark.tumblr.com/, the blog of a
researcher who uses deep neural networks to generate proverbs, Harry Potter
fanfiction, plausible names for kittens, bands, Star Wars planets, etc. The
author of the framework used takes it even further at
http://karpathy.github.io/2015/05/21/rnn-effectiveness/, using neural
networks to generate *algebraic geometry papers in LaTeX that damn' near
compiles first time*, making it a better LaTeX coder than most
mathematicians - and the text makes about as much sense as most algebraic
geometry papers, too*.

Inspired by this, and James Mickens' comments about Perl in his essay The
Night Watch (https://www.usenix.org/system/files/1311_05-08_mickens.pdf -
read the whole thing), I thought I'd try using a neural network to generate
Perl. I downloaded Karpathy's char-rnn framework onto an AWS deep-learning
high-GPU instance and trained it on the Perl 5.16 core modules for an hour
or so. Here are some results, at successive stages of training:


Af opdiir fust be deturn
i perless use sige-C. 5., in ored: foiny purger arl be 2il zefsip dule dx
- use C<$ndmriv qw 1, at .

=item C<chrel;
is jch

use MOCE_TE L SEMP => 0, CAK;
use CFCOUK_> is 'st cut asher dir by $_,..), char fuvpe ar a ure subgs
ItO; my constant ond (and dastpinatian as
meuod.


Sampled from Acme::Chaucer, perhaps?


sub _close_name { require $did, \¬ even( $cx . ', ) to join " map"",
24%]\n") }
sub point_files_tok { 1 cloar
                # _uilops made above a value
        # sqrt( f.) as number inhernal dow recorst from read1
nece_lanc/Qirds"
        unless ($x eq 'SPEC')      (sqrt(1),->[0]);             # 25s"
      }
      degain @{$n->[1]}' },
                        | pA<(  [x,s[r,));
           $parser{$sing} = $textdomain if $options{$cunc};
        # indectvilication of
                # Make toherride
                    $class .= defined $pp in $cv ? "$_[1]",
\$typecislation]';
                return "\"   /exists eq "[\\L\\\\[",
                          hex $$prcf)";
        return undef $sytv{$r};
        }
}
@invlistS->out;
# tigetlest of a does no level, or thy offset:


Getting warmer, though still a little Shakespearean.


=head1 SYNOPSIS

  use Time::Local;

  my $index = $obj - $self->{'Thispara'} ? $arg->batch_mode($recode, $port);
  return '...'s
  - if index & no open2: $obj, host';
  $num_short = svent();
  return 1;
  }

  return   grep ! $singhe > 10 );


Moving on...


sub set_use_utf8_stringy_for_cases
{
    my ($self, $url, $array, $_line,  $subseq) = @_;

    if ($self->{"seq"} eq $self->{"pid"}) {
        $ip = $self->is_pageap($self->pitpath_size($path, $retvals);
            DEBUG > 1 and print " PerlCaintor_head for some storain time
with Reven Reposition!\n" if sall error with "#reviae""
              $arg->{name})) if $self->{undef_text} || "';
            $path = $self->DEE Windows --$initial_tabunt+Otigs_msg;
          );
        }
    });
}


And here's some output from the most recent checkpoint:


modichion(), for $x > 2)

Month did not copy the directory as ASCII.

This will need to use the copy to disable them misleven.

=cut

# GetOptions_argument spaces may still already yet, [. no command
@cnd->register_unix_rc_file

sub do({})$KB::binwhost} {
    require POSIX*text    bull if @_;
    eval { dtack => 000000 };
    my $code = caller;
    $obj->EVERY::LangVarAdate($fh, $flag);
    $space .= '|doesn' or tagname => '$local_addr' };

Pod::Simple::DEBUG (server extension tree and whenever every unexpandid.

=head1 NAME

Pod::Simple objects in in pre-same as Procusesen-regex

use Config;
if $_[0] {
    local(*>), pack(" glob),
              SCALAR => [Metackeque_legator,
                The Perl scalar data local *OS/TODE::/own.gat/params";
        next if %s
        carp _command_syscopy($fn), @files ],
                = @global;
        sub import

        "Digest 's 2-lingain\n",
                = package;
            if (exists $tryopen) {
            $self->{targless} = $tabstop - 1;
        }
        elsif ( $
                      {
            unshift @to_unget,
                                           );
                return ();
    }
#    }
    $to_ungers->{$output} ||= 0;
}

=item $_

The function named scopy "i.png") or one of the integer hasnct
system until the file can be interested and executed to commony then the
destination constructor is imperred,
or the sqrt_data
is translined directory. It is not match from this object rmrithed
succeditions (e.g. C<utf8::is_scope(...)> in their object.
Instead of a file, but this is with the I<scalar_hash>. They increases
C<@ARGV>, B<tabrit>
are passed.


I'll train it a bit longer and see what happens :-)

Miles

* IANAAG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/edinburgh-pm/attachments/20170721/0c313030/attachment.html>


More information about the Edinburgh-pm mailing list