-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDemo.html
1720 lines (1676 loc) · 96.9 KB
/
Demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NeuralJS demo</title>
<style>
body {
padding: 20px;
color: #333;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
#wrap {
width: 1000px;
margin-right: auto;
margin-left: auto;
margin-bottom: 200px;
}
.abutton {
width: 120px;
height: 30px;
margin: 10px 10px 10px 10px;
}
</style>
<link href="external/jquery-ui.min.css" rel="stylesheet">
<script src="external/jquery-1.12.1.js"></script>
<script src="external/jquery-ui.min.js"></script>
<script src="src/neural.js"></script>
<script type="text/javascript">
/*
* parameter for the neural network and variable declarations
*/
var letterSize = 5, // size of letter embeddings
regularizationConstant = 0.000001, // L2 regularization strength
initialLearningRate = 0.001,
learningRate = initialLearningRate,
clipValue = 1, // clip gradients at this value
numberSamples = 5,
learningRateAnnealing = 0.99,
dataSentences = [],
vocabulary = [],
letterToIndex = [],
indexToLetter = [],
network = {},
vocabularySize = -1,
outputSize = -1,
epochSize = -1,
maxCharsGenerated = 100,
tickCount = 0;
/*
* scans through all sentences and creates the vocabulary of all unique chars
*/
function initVocabulary(sentences, countThreshold) {
var text = sentences.join('');
// count all characters
var d = {};
for (var i = 0, n = text.length; i < n; i++) {
var textI = text[i];
if (textI in d) { d[textI] += 1; }
else { d[textI] = 1; }
}
// filter by countThreshold
vocabulary = [];
letterToIndex = {};
indexToLetter = {};
// start at one because zero will be for start and end tokens
var q = 1;
for (var character in d) {
if (d.hasOwnProperty(character)) {
if (d[character] >= countThreshold) {
// add character to vocabulary
letterToIndex[character] = q;
indexToLetter[q] = character;
vocabulary.push(character);
q++;
}
}
}
vocabularySize = vocabulary.length + 1;
outputSize = vocabulary.length + 1;
epochSize = sentences.length;
$('#charactersFound').html(vocabulary.length + ' different characters found: ' + vocabulary.join(''));
}
/*
* (re)initializes the vocabulary, network and learningRate
*/
function reinit() {
// process the input and filter out blanks
var dataSentencesRaw = $('#textInput').val().split('\n');
for (var i = 0, n = dataSentencesRaw.length; i < n; i++) {
var sentence = dataSentencesRaw[i].trim();
if (sentence.length > 0) {
dataSentences.push(sentence);
}
}
initVocabulary(dataSentences, 1);
var networkType = $('input[name=radioNetwork]:checked').val();
network = new Neuraljs.NeuralNetwork(networkType);
var hiddenSizes = JSON.parse($('#NetworkSize').val());
network.initialize(letterSize, hiddenSizes, outputSize);
network.generateInputMatrix(vocabularySize);
tickCount = 0;
learningRate = initialLearningRate;
}
/*
* function that calculates the perplexity and cost for a single sentence
* - also performs forward passes for every character
*/
function costFunction(network, sentence) {
var inputVectorArray = [],
targetIndexArray = [],
i,
n = sentence.length,
sourceIndex,
targetIndex,
result,
costPerplexityDiv;
for (i = -1; i < n; i++) {
sourceIndex = (i === -1 ? 0 : letterToIndex[sentence[i]]);
targetIndex = (i === n -1 ? 0 : letterToIndex[sentence[i + 1]]);
inputVectorArray.push(network.getInputVector(sourceIndex));
targetIndexArray.push(targetIndex);
}
result = network.batchCostFunction(inputVectorArray, targetIndexArray);
costPerplexityDiv = '<div> perplexity: ' + result.perplexity.toFixed(1) + ' cost: ' + result.cost.toFixed(1) + '</div>';
$('#costPerplexity').html(costPerplexityDiv);
}
/*
* function that creates a sentence as predicted by the network
*/
function getSentence(network, useSampling) {
var string = '';
while (true) {
var index = string.length === 0 ? 0 : letterToIndex[string[string.length-1]];
var sourceVector = network.getInputVector(index);
var prediction = network.predictOutput(sourceVector, useSampling, 1.0);
if (prediction === 0) break;
if (string.length > maxCharsGenerated) break;
string += indexToLetter[prediction];
}
return string;
}
/*
* function that gets called in a loop while the user has not hit pause
* it performs one full cycle of the neural network with one sentence as batch of input
*/
function tick() {
// sample sentence from data
var sentenceIndex = Math.floor(Math.random() * dataSentences.length);
var sentence = dataSentences[sentenceIndex];
var time0 = (new Date()).getTime();
// evaluate cost of a sentence
costFunction(network, sentence);
//compute backpropagation
network.backward();
// perform parameter update - learning Rate not optional
network.parameterUpdate(learningRate, regularizationConstant, clipValue);
var time1 = (new Date()).getTime();
var tickTime = time1 - time0;
tickCount++;
if (tickCount % (Math.floor(epochSize/100)) === 0) {
$('#epochs').text('Epoch: ' + (tickCount/epochSize).toFixed(2));
}
if (tickCount % (Math.floor(epochSize)) === 0) {
// anneals the learning rate slowly over time
learningRate *= learningRateAnnealing;
}
if (tickCount % 10) {
$('#ticktime').text('forw/bwd time per example: ' + tickTime.toFixed(1) + 'ms');
}
if (tickCount % 50 === 0) {
$('#samples').html('');
var prediction;
var predictionDiv;
for (var j = 0; j < numberSamples; j++) {
prediction = getSentence(network, true);
predictionDiv = '<div class="aprediction">' + prediction + '</div>';
$('#samples').append(predictionDiv);
}
prediction = getSentence(network, false);
predictionDiv = '<div class="aprediction">' + prediction + '</div>';
$('#greedySamples').html(predictionDiv);
console.log(prediction);
console.log(learningRate);
}
}
var iid = null;
$(function() {
// attach button handlers
$('#learn').click(function() {
reinit();
if (iid !== null) { clearInterval(iid); }
iid = setInterval(tick, 0);
});
$('#stop').click(function() {
if (iid !== null) { clearInterval(iid); }
iid = null;
});
$('#resume').click(function() {
if (iid === null) {
iid = setInterval(tick, 0);
}
});
$('#learn').click(); // simulate click on startup
})
</script>
</head>
<body>
<div id="wrap">
<h1>NeuralJS demo</h1>
<div id="intro">
This is a demo for the Neuraljs javascript library. It allows you to train Recurrent Neural Networks (RNN),
Long Short-Term Memory Networks (LSTM) and Gated Recurrent Units (GRU). <br>
To demonstrate the behaviour we will take a text - a sequence of characters - as input and let the neural network predict
the next character in the sequence.
</div>
<div>
<div class="heading">Input text:</div>
<textarea style="width:100%;height:200px;" id="textInput">the company has, say, 6 months of runway
or to put it more brutally, 6 months before they're out of business
they expect to avoid that by raising more from investors
that last sentence is the fatal one
it's hard to convince investors the first time too, but founders expect that
what bites them the second time is a confluence of three forces:
the company is spending more now than it did the first time it raised money
investors have much higher standards for companies that have already raised money
the company is now starting to read as a failure
the first time it raised money, it was neither a success nor a failure; it was too early to ask
i'm going to call the situation i described in the first paragraph "the fatal pinch
one of the things that makes the fatal pinch so dangerous is that it's self-reinforcing
y combinator tells founders who raise money to act as if it's the last they'll ever get
i will now, by an amazing feat of clairvoyance, do this for you: the probability is zero
you should shut down the company if you're certain it will fail no matter what you do
companies rarely have to fail though
what i'm really doing here is giving you the option of admitting you've already given up
if you don't want to shut down the company, that leaves increasing revenues and decreasing expenses
in most startups, expenses people and decreasing expenses firing people
if so, now's the time
which leaves two options, firing good people and making more money
you should lean more toward firing people if the source of your trouble is overhiring
plus those 15 people might not even be the ones you need for whatever you end up building
so the solution may be to shrink and then figure out what direction to grow in
it may seem facile to suggest a startup make more money, as if that could be done for the asking
usually a startup is already trying as hard as it can to sell whatever it sells
but only work on whatever will get you the most revenue the soonest
or you may have expertise in some new field they don't understand
and to the extent you can, try to avoid the worst pitfalls of consulting
you keep the ip and no billing by the hour
you just have to realize in time that you're near death
and if you're in the fatal pinch, you are
it struck me recently how few of the most successful people i know are mean
there are exceptions, but remarkably few
meanness isn't rare
in fact, one of the things the internet has shown us is how mean people can be
a few decades ago, only famous people and professional writers got to publish their opinions
now everyone can, and we can all see the long tail of meanness that had previously been hidden
what's going on here? are meanness and success inversely correlated?
part of what's going on, of course, is selection bias
i only know people who work in certain fields: startup founders, programmers, professors
i'm willing to believe that successful people in other fields are mean
maybe successful hedge fund managers are mean; i don't know enough to say
it seems quite likely that most successful drug lords are mean
being married to her is like standing next to an airport baggage scanner
why? i think there are several reasons
one is that being mean makes you stupid
that's why i hate fights
you never do your best work in a fight, because fights are not sufficiently general
winning is always a function of the situation and the people involved
and yet fighting is just as much work as thinking about real problems
startups don't win by attacking
they win by transcending
there are exceptions of course, but usually the way to win is to race ahead, not to stop and fight
another reason mean founders lose is that they can't get the best people to work for them
they can hire people who will put up with them because they need a job
but the best people have other options
a mean person can't convince the best people to work for him unless he is super convincing
and while having the best people helps any organization, it's critical for startups
the startup founders who end up richest are not the ones driven by money
[1] the ones who keep going are driven by something else
they may not say so explicitly, but they're usually trying to improve the world
which means people with a desire to improve the world have a natural advantage
this kind of work is the future
for most of history success meant control of scarce resources
for most of history, success meant success at zero-sum games
and in most of them meanness was not a handicap but probably an advantage
that is changing
increasingly the games that matter are not zero-sum
there have long been games where you won by having new ideas
in the third century bc archimedes won by doing that
at least until an invading roman army killed him
and not just not being at war
people need to feel that what they create can't be stolen
that has always been the case for thinkers, which is why this trend began with them
the exciting thing is that their m
seems to be spreading
so i'm really glad i stopped to think about this
jessica and i have always worked hard to teach our kids not to be mean
we tolerate noise and mess and junk food, but not meanness
startups are very counterintuitive
i'm not sure why
maybe it's just because knowledge about them hasn't permeated our culture yet
but whatever the reason, starting a startup is a task where you can't always trust your instincts
it's like skiing in that way
when you first try skiing and you want to slow down, your instinct is to lean back
but if you lean back on skis you fly down the hill out of control
so part of learning to ski is learning to suppress that impulse
eventually you get new habits, but at first it takes a conscious effort
at first there's a list of things you're trying to remember as you start down the hill
startups are as unnatural as skiing, so there's a similar list for startups
counterintuitive
if you know nothing more than this, you may at least pause before making them
it's really true
they seem wrong
so of course your first impulse is to disregard them
if founders' instincts already gave them the right answers, they wouldn't need us
you only need other people to give you advice that surprises you
that's why there are a lot of ski instructors and not many running instructors
you can, however, trust your instincts about people
and in fact one of the most common mistakes young founders make is not to do that enough
if someone seems slippery, or bogus, or a jerk, don't ignore it
this is one case where it pays to be self-indulgent
work with people you genuinely like, and you've known long enough to be sure
the second counterintuitive point is that it's not that important to know a lot about startups
mark zuckerberg didn't succeed because he was an expert on startups
if you don't know anything about, say, how to raise an angel round, don't feel bad on that account
that sort of thing you can learn when you need to, and forget after you've done it
" it would set off alarms
from the outside that seems like what startups do
we saw this happen so often that we made up a name for it: playing house
eventually i realized why it was happening
think about what you have to do to get into college, for example
extracurricular activities, check
even in college classes most of the work is as artificial as running laps
i'm not attacking the educational system for being this way
i confess i did it myself in college
it was like a game
then they want to know what the tricks are for growing fast
and we have to tell them the best way to do that is simply to make something people want
" and the partner replying "just
gaming the system may continue to work if you go to work for a big company
[2] but that doesn't work with startups
startups are as impersonal as physics
you have to make something people want, and you prosper only to the extent you do
the dangerous thing is, faking does work to some degree on investors
but it's not in your interest to
the company is ultimately doomed
all you're doing is wasting your own time riding it down
so stop looking for the trick
it's exciting that there even exist parts of the world where you win by doing good work
how do you win in each type of work, and what would you like to win by doing? [4]
all-consuming
that brings us to our fourth counterintuitive point: startups are all-consuming
if you start a startup, it will take over your life to a degree you cannot imagine
so there is a real opportunity cost here
larry page may seem to have an enviable life, but there are aspects of it that are unenviable
if he goes on vacation for even a week, a whole week's backlog of shit accumulates
it never gets any easier
the nature of the problems change
but the total volume of worry never decreases; if anything it increases
many of which will make you a better parent when you do have kids
and since you can delay pushing the button for a while, most people in rich countries do
to be fair, the universities have their hand forced here
a lot of incoming students are interested in startups
universities are, at least de facto, expected to prepare them for their careers
so students who want to start startups hope universities can teach them about startups
can universities teach students about startups? yes and no
[5] so starting a startup is intrinsically something you can only really learn by doing it
you may be nominally a student for a bit, but you won't even be that for long
do not start a startup in college
starting a startup is like a brutally fast depth-first search
most people should still be searching breadth-first at 20
if you start a startup at 20 and you're sufficiently successful, you'll never get to do it
mark zuckerberg will never get to bum around a foreign country
he can do other things most people can't, like charter jets to fly him to foreign countries
but success has taken a lot of the serendipity out of his life
facebook is running him as much as he's running facebook
among other things it gives you more options to choose your life's work from
there's not even a tradeoff here
should you do it at any age? i realize i've made startups sound pretty hard
if i haven't, let me try again: starting a startup is really hard
what if it's too hard? how can you tell if you're up to this challenge?
the answer is the fifth counterintuitive point: you can't tell
starting a startup will change you a lot
it was easy to tell how smart they were, and most people reading this will be over that threshold
the hard part was predicting how tough and ambitious they would become
the founders sometimes think they know
if you're absolutely terrified of starting a startup, you probably shouldn't do it
but if you're merely unsure whether you're up to it, the only way to find out is to try
just not now
for getting both is the same
i've written a whole essay on this, so i won't repeat it all here
the way to come up with good startup ideas is to take a step back
in fact, so unconsciously that you don't even realize at first that they're startup ideas
this is not only possible, it's how apple, yahoo, google, and facebook all got started
none of these companies were even meant to be companies at first
they were all just side projects
the third part, incidentally, is how you get cofounders at the same time as the idea
" but that prescription, though sufficient, is too narrow
what was special about brian chesky and joe gebbia was not that they were experts in technology
what kind of problems are those? that is very hard to answer in the general case
so how do you know when you're working on real stuff? [8]
i know how i know
y combinator itself was something i only did because it seemed interesting
so i seem to have some sort of internal compass that helps me out
but i don't know what other people have in their heads
and indeed, probably also the best way to live
you may not realize they're startup ideas, but you'll know they're something that ought to exist
he didn't mean it to be a startup, and he never tried to turn it into one
" it's the classic version of college as education for its own sake
the component of entrepreneurship that really matters is domain expertise
the way to become larry page was to become an expert on search
at its best, starting a startup is merely an ulterior motive for curiosity
and you'll do it best if you introduce the ulterior motive toward the end of the process
most startups that raise money do it more than once
reality can be messier
some companies raise money twice in phase 2
others skip phase 1 and go straight to phase 2
but the three phase path is at least the one about which individual startups' paths oscillate
this essay focuses on phase 2 fundraising
that problem is irreducible; it should be hard
but much of the other kind of difficulty can be eliminated
you can't trust your intuitions
i'm going to give you a set of rules here that will get you through this process if anything will
at certain moments you'll be tempted to ignore them
so rule number zero is: these rules exist for a reason
the ultimate source of the forces acting on you are the forces acting on investors
but that fast growth means investors can't wait around
if you wait till a startup is obviously a success, it's too late
but that in turn makes investors nervous they're about to invest in a flop
as indeed they often are
what investors would like to do, if they could, is wait
but if you wait too long, other investors might take the deal away from you
and of course the other investors are all subject to the same forces
don't raise money unless you want it and it wants you
actually it isn't
rapid growth is what makes a company a startup
the other time not to raise money is when you won't be able to
be in fundraising mode or not
one of the things that surprises founders most about fundraising is how distracting it is
when you start fundraising, everything else grinds to a halt
the problem is not the time fundraising consumes but that it becomes the top idea in your mind
a startup can't endure that level of distraction for long
because fundraising is so distracting, a startup should either be in fundraising mode or not
you can take money from investors when you're not in fundraising mode
you just can't expend any attention on it
there are two things that take attention: convincing investors, and negotiating with them
[3] the terms will be whatever they turn out to be in your next equity round
investors will try to lure you into fundraising when you're not
it's great for them if they can, because they can thereby get a shot at you before everyone else
they'll send you emails saying they want to meet to learn more about you
deals don't happen that way
they may say they just want to meet and chat, but investors never just want to meet and chat
get introductions to investors
before you can talk to investors, you have to be introduced to them
if you're presenting at a demo day, you'll be introduced to a whole bunch simultaneously
but even if you are, you should supplement these with intros you collect yourself
do you have to be introduced? in phase 2, yes
intros vary greatly in effectiveness
the best type of intro is from a well-known investor who has just invested in you
so when you get an investor to commit, ask them to introduce you to other investors they respect
[7] the next best type of intro is from a founder of a company they've funded
you can also get intros from other people in the startup community, like lawyers and reporters
there are now sites like angellist, fundersclub, and wefunder that can introduce you to investors
we recommend startups treat them as auxiliary sources of money
raise money first from leads you get yourself
those will on average be better investors
hear no till you hear yes
i mentioned earlier that investors prefer to wait if they can
what's particularly dangerous for founders is the way they wait
essentially, they lead you on
they seem like they're about to invest right up till the moment they say no
if they even say no
some of the worse ones never actually do say no; they just stop replying to your emails
they hope that way to get a free option on investing
that's not the worst thing investors will do
and wishful thinking founders are happy to meet them half way
fortunately, the next rule is a tactic for neutralizing this behavior
but to work it depends on you not being tricked by the no that sounds like yes
if you believe an investor has committed, get them to confirm it
and till they confirm, regard them as saying no
do breadth-first search weighted by expected value
when you talk to investors your m
should be breadth-first search, weighted by expected value
you should always talk to investors in parallel rather than serially
meet such investors last, if at all
but you have to be disciplined about assigning probabilities
you can't let how much you want an investor influence your estimate of how much they want you
know where you stand
never leave a meeting with an investor without asking what happens next
if you're experienced at negotiations, you already know how to ask such questions
[13] if you're not, there's a trick you can use in this situation
investors know you're inexperienced at raising money
inexperience there doesn't make you unattractive
larry and sergey were noobs at fundraising
get the first commitment
the biggest factor in most investors' opinions of you is the opinion of other investors
once you start getting investors to commit, it becomes increasingly easy to get more to
but the other side of this coin is that it's often hard to get the first commitment
getting the first substantial offer can be half the total difficulty of fundraising
what counts as a substantial offer depends on who it's from and how much it is
money from friends and family doesn't usually count, no matter how much
close committed money
it's not a deal till the money's in the bank
and it's also one that furnishes them plenty of excuses to gratify it
the public markets snap startup investing around like a whip
if the chinese economy blows up tomorrow, all bets are off
tomorrow a big competitor could appear, or you could get cded, or your cofounder could quit
even a day's delay can bring news that causes an investor to change their mind
so when someone commits, get the money
knowing where you stand doesn't end when they say they'll invest
inexperienced investors are the ones most likely to get buyer's remorse
but i've heard of cases of even top-tier vc firms welching on deals
avoid investors who don't "lead
some investors are known for deciding quickly, and those are extra valuable early on
conversely, an investor who will only invest once other investors have is worthless initially
you can recognize this contemptible subspecies of investor because they often talk about "leads
" they say that they don't lead, or that they'll invest once you have a lead
now there are rarely actual rounds before the a round, or leads for them
now startups simply raise money from investors one at a time till they feel they have enough
the spectral signature of all mediocre investors
have multiple plans
many investors will ask how much you're planning to raise
this question makes founders feel they should be planning to raise a specific amount
but in fact you shouldn't
it's a mistake to have fixed plans in an undertaking as unpredictable as fundraising
" i've known a handful of founders who could pull that off without having vcs laugh in their faces
different plans match different investors
$15k per month is high, so don't actually spend that much
but it's ok to use a high estimate when fundraising to add a margin for error
if you have additional expenses, like manufacturing, add in those at the end
underestimate how much you want
then when you reach $150k you're more than half done
whereas if you'd said you were raising $500k, you'd be less than a third done at $150k
if fundraising stalled there for an appreciable time, you'd start to read as a failure
saying initially that you're raising $250k doesn't limit you to raising that much
startups do that all the time
i'm not saying you should lie, but that you should lower your expectations initially
there is almost no downside in starting with a low number
it not only won't cap the amount you raise, but will on the whole tend to increase it
a good metaphor here is angle of attack
if you try to fly at too steep an angle of attack, you just stall
be profitable if you can
if you can make it to profitability without raising any additional money
there are many analogies between fundraising and dating, and this is one of the strongest
no one wants you if you seem desperate
and the best way not to seem desperate is not to be desperate
and they are then surprised how difficult and unpleasant it is
of course not all startups can make it to ramen profitability in a few months
don't optimize for valuation
founders who raise money at high valuations tend to be unduly proud of it
this is stupid, because fundraising is not the test that matters
the real test is revenue
fundraising is just a means to that end
being proud of how well you did at fundraising is like being proud of your college grades
number two is good investors
valuation is at best third
the empirical evidence shows just how unimportant it is
6 million respectively
so let that satisfy your competitiveness
you're doing better than dropbox and airbnb at a test that doesn't matter
it will be easier to raise money at a lower valuation
it shouldn't be, but it is
but although it's a mistake for investors to care about price, a significant number do
yesno before valuation
some investors want to know what your valuation is before they even talk to you about investing
fortunately there is a way to avoid naming a price in this situation
and it is not just a negotiating trick; it's how you (both) should be operating
then if they decide they do want to invest, you can figure out a price
but first things first
this is a safe technique so long as you combine it with the next one
beware "valuation sensitive" investors
occasionally you'll encounter investors who describe themselves as "valuation sensitive
you should therefore never approach such investors first
this way, you'll not only get market price, but it will also take less time
so you'd only want to talk to this sort of investor if you were about to do that anyway
if you're surprised by a lowball offer, treat it as a backup offer and delay responding to it
but lowballing you is a dick move that should be met with the corresponding countermove
accept offers greedily
a greedy algorithm takes the best of the options in front of it right now
and that is how startups should approach fundraising in phases 2 and later
if someone makes you an acceptable offer, take it
if you have multiple incompatible offers, take the best
don't reject an acceptable offer in the hope of getting a better one in the future
these simple rules cover a wide variety of cases
if you're raising money from many investors, roll them up as they say yes
as you start to feel you've raised enough, the threshold for acceptable will start to get higher
in practice offers exist for stretches of time, not points
so when you get an acceptable offer that would be incompatible with others (e
this could lose you some that might have made an offer if they had more time
but by definition you don't care; the initial offer was acceptable
a deadline of three working days is acceptable
you shouldn't need more than that if you've been talking to investors in parallel
but a deadline any shorter is a sign you're dealing with a sketchy investor
you can usually call their bluff, and you may need to
but if it does, "get the best investors" is in the average case bad advice
the best investors are also the most selective, because they get their pick of all the startups
(the situation is different in phase 1
there's no practical difficulty
if the smaller investments are on convertible notes, they'll just convert into the series a round
till they do, you don't know for sure they will, and the greedy algorithm tells you what to do
don't sell more than 25% in phase 2
if you do well, you will probably raise a series a round eventually
i say probably because things are changing with series a rounds
startups may start to skip them
which means you should avoid doing things in earlier rounds that will mess up raising an a round
guess conservatively
have one person handle fundraising
(if the founders mistrust one another, this could cause some friction
even if the ceo is a programmer and another founder is a salesperson? yes
but wait till that point
you'll need an executive summary and (maybe) a deck
traditionally phase 2 fundraising consists of presenting a slide deck in person to investors
a lot of the most successful startups we fund never make decks in phase 2
they just talk to investors and explain what they plan to do
but don't refuse on that account to give copies to investors you meet
you just have to treat such leaks as a cost of doing business
in practice it's not that high a cost
i wouldn't do that
it's a sign they're not really interested
stop fundraising when it stops working
when do you stop fundraising? ideally when you've raised enough
but what if you haven't raised as much as you'd like? when do you give up?
when your fundraising options run out, they usually run out in the same way
don't keep sucking on the straw if you're just getting air
it's not going to get better
don't get addicted to fundraising
the work at an early stage startup often consists of unglamorous schleps
whereas fundraising, when it's going well, can be quite the opposite
the danger of fundraising is particularly acute for people who are good at it
it's always fun to work on something you're good at
if you're one of these people, beware
fundraising is not what will make your company successful
listening to users complain about bugs in your software is what will make you successful
startups can be destroyed by this
don't raise too much
though only a handful of startups have to worry about this, it is possible to raise too much
the dangers of raising too much are subtle but insidious
one is that it will set impossibly high expectations
a company's valuation is expected to rise each time it raises money
if not it's a sign of a company in trouble, which makes you unattractive to investors
and you have to be doing really, really well to raise money at $50 million
but the money itself may be more dangerous than the valuation
so if you do raise a huge amount of money, don't spend it
startups raising money occasionally alienate investors by seeming arrogant
it's a mistake to behave arrogantly to investors
the only safe strategy is never to seem arrogant at all
so you must cushion the blow with soft words
at yc we tell startups they can blame us
and now that i've written this, everyone else can blame me if they want
the danger of behaving arrogantly is greatest when you're doing well
when everyone wants you, it's hard not to let it go to your head
especially if till recently no one wanted you
but restrain yourself
the startup world is a small place, and startups have lots of ups and downs
this is a domain where it's more true than usual that pride goeth before a fall
be nice when investors reject you as well
the best investors are not wedded to their initial opinion of you
if they reject you in phase 2 and you end up doing well, they'll often invest in phase 3
in fact investors who reject you are some of your warmest leads for future fundraising
any investor who spent significant time deciding probably came close to saying yes
the bar will be higher next time
assume the money you raise in phase 2 will be the last you ever raise
you must make it to profitability on this money if you can
this is probably the optimal strategy for investors
it's too hard to pick winners early on
better to let the market do it for you
but it often comes as a surprise to startups how much harder it is to raise money in phase 3
the next time you raise money, the experiment has to have worked
you have to be on a trajectory that leads to going public
and while there are some ideas where the proof that the experiment worked might consist of e
query response times, usually the proof is profitability
usually phase 3 fundraising has to be type a fundraising
in practice there are two ways startups hose themselves between phases 2 and 3
some are just too slow to become profitable
they raise enough money to last for two years
there doesn't seem any particular urgency to be profitable
so they don't make any effort to make money for a year
but by that time, not making money has become habitual
when they finally decide to try, they find they can't
the other way companies hose themselves is by letting their expenses grow too fast
which almost always means hiring too many people
you usually shouldn't go out and hire 8 people as soon as you raise money at phase 2
usually you want to wait till you have growth (and thus usually revenues) to justify them
a lot of vcs will encourage you to hire aggressively
don't listen to them
don't make things complicated
that's fundraising in one sentence
don't introduce complicated optimizations, and don't let investors introduce complications either
fundraising is not what will make you successful
it's just a means to an end
be good, take care of yourselves, and don't leave the path
the biggest component in most investors' opinion of you is the opinion of other investors
which is of course a recipe for exponential growth
but actually the two are not that highly correlated
if you understand them, you can at least avoid being surprised
raising money decreases the risk of failure
plus a company that has raised money is literally more valuable
though they're often clueless about technology, most investors are pretty good at reading people
when fundraising is going well, investors are quick to sense it in your increased confidence
judging startups is hard even for the best investors
the mediocre ones might as well be flipping coins
the best investors aren't influenced much by the opinion of other investors
it would only dilute their own judgment to average it together with other people's
this is the fourth way in which offers beget offers
founders try this sort of thing all the time, and investors are very sensitive to it
if anything oversensitive
but you're safe so long as you're telling the truth
there's no manipulation in that
do not, however, tell a who b is
vcs will sometimes ask which other vcs you're talking to, but you should never tell them
angels you can sometimes tell about other angels, because angels cooperate more with one another
the second will be easier
the right way to lift heavy things is to let your legs do the work
inexperienced founders make the same mistake when trying to convince investors
they try to convince with their pitch
investors are looking for startups that will be very successful
but that test is not as simple as it sounds
the big successes are so big they dwarf the rest
but angel investors like big successes too
the most important ingredient is formidable founders
[2] every startup has reasons both to invest and not to invest
if investors think you're a winner they focus on the former, and if not they focus on the latter
for example, it might be a rich market, but with a slow sales cycle
they're not necessarily trying to mislead you
most investors are genuinely unclear in their own minds why they like or dislike startups
if you seem like a winner, they'll like your idea more
but don't be too smug about this weakness of theirs, because you have it too; almost everyone does
there is a role for ideas of course
they're fuel for the fire that starts with liking the founders
" (whereas when they don't like you, they'll be saying "but what about x?")
formidable is close to confident, except that someone could be confident and mistaken
formidable is roughly justifiably confident
what should they do? [4]
what they should not do is try to imitate the swagger of more experienced founders
investors are not always that good at judging technology, but they're good at judging confidence
if you try to act like something you're not, you'll just end up in an uncanny valley
you'll depart from sincere, but never arrive at convincing
the way to seem most formidable as an inexperienced founder is to stick to the truth
how formidable you seem isn't a constant
it varies depending on what you're saying
that's the secret
and by convince yourself, i don't mean play mind games with yourself to boost your confidence
i mean truly evaluate whether your startup is worth investing in
if it isn't, don't try to raise money
to evaluate whether your startup is worth investing in, you have to be a domain expert
which in fact it will usually be
know everything about your market
when the unfortunate fellow got to his last slide, the professor burst out:
which one of these conclusions do you actually believe?
even if you have no ideas
you have to produce something
and all too many startups go into fundraising in the same spirit
it's when you can convince investors, and not before
if you try convincing investors before you've convinced yourself, you'll be wasting both your time
but pausing first to convince yourself will do more than save you from wasting your time
it will force you to organize your thoughts
and if you can do that you'll end up with more than added confidence
you'll also have a provisional roadmap of how to succeed
no one knows whether a startup is going to succeed
startup investors know that every investment is a bet, and against pretty long odds
founders think of startups as ideas, but investors think of them as markets
your target market has to be big, and it also has to be capturable by you
but the market doesn't have to be big yet, nor do you necessarily have to be in it yet
the standard of plausibility varies dramatically depending on the age of the startup
microsoft for example was not going to grow huge selling basic interpreters
good, but not great
no company, however successful, ever looks more than a pretty good bet a few months in
microcomputers turned out to be a big deal, and microsoft both executed well and got lucky
but it was by no means obvious that this was how things would play out
plenty of companies seem as good a bet a few months in
and who can reasonably expect more of a startup than that?
if you can make as good a case as microsoft could have, will you convince investors? not always
a lot of vcs would have rejected microsoft
[9] certainly some rejected google
this is arguably a permissible tactic
it's arguably an instance of scamming a scammer
if you know you're on the right track, then you also know why investors were wrong to reject you
experienced investors are well aware that the best ideas are also the scariest
they all know about the vcs who rejected google
that's what happened to dropbox
yet another backup and syncing thing, they all thought
a couple weeks later, dropbox raised a series a round from sequoia
you can convince yourself, then convince them
and when you convince them, use the same matter-of-fact language you used to convince yourself
you wouldn't use vague, grandiose marketing-speak among yourselves
don't use it with investors either
it not only doesn't work on them, but seems a mark of incompetence
just be concise
so here's the recipe for impressing investors when you're not already good at seeming formidable:
make something worth investing in
understand why it's worth investing in
explain that clearly to investors
if you're saying something you know is true, you'll seem confident when you're saying it
conversely, never let pitching draw you into bullshitting
as long as you stay on the territory of truth, you're strong
make the truth good, then just tell it
one of the most common types of advice we give at y combinator is to do things that don't scale
a lot of would-be founders believe that startups either take off or don't
or they don't, in which case the market must not exist
actually startups take off because the founders make them take off
a good metaphor would be the cranks that car engines had before they got electric starters
the most common unscalable thing founders have to do at the start is to recruit users manually
nearly all startups have to
you can't wait for users to come to you
you have to go out and get them
if anyone could have sat back and waited for users, it was stripe
but in fact they're famous within yc for aggressive early user acquisition
at yc we use the term "collison installation" for the technique they invented
" but the collison brothers weren't going to wait
there are two reasons founders resist going out and recruiting users individually
one is a combination of shyness and laziness
the other reason founders ignore this path is that the absolute numbers seem so small at first
this can't be how the big, famous startups got started, they think
the mistake they make is to underestimate the power of compound growth
we encourage every startup to measure their progress by weekly growth rate
if you have 100 users, you need to get 10 more next week to grow 10% a week
after a year you'll have 14,000 users, and after 2 years you'll have 2 million
airbnb is a classic example of this technique
marketplaces are so hard to get rolling that you should expect to take heroic measures at first
that initial fragility was not a unique feature of airbnb
almost all startups are fragile initially
they unconsciously judge larval startups by the standards of established ones
it's harmless if reporters and know-it-alls dismiss your startup
they always get things wrong
it's even ok if investors dismiss your startup; they'll change their minds when they see growth
the big danger is that you'll dismiss your startup yourself
i've seen it happen
i often have to encourage founders who don't see the full potential of what they're building
even bill gates made that mistake
he returned to harvard for the fall semester after starting microsoft
they were just trying to survive
but in retrospect that too was the optimal path to dominating a big market
otherwise you'll have to make a more deliberate effort to locate the most promising vein of users
you should take extraordinary measures not just to acquire users, but also to make them happy
your first users should feel that signing up with you was one of the best choices they ever made
and you in turn should be racking your brains to think of new ways to delight them
you can be ornery when you're scotty, but not when you're kirk
that would be a great problem to have
see if you can make it happen
tim cook doesn't send you a hand-written note after you buy a laptop
but you can
that's one advantage of being small: you can provide a level of service no big company can
steve wasn't just using "insanely" as a synonym for "very
what novice founders don't get is what insanely great translates to in a larval startup
when steve jobs started using that phrase, apple was already an established company
that's not hard for engineers to grasp
it's just a more extreme version of designing a robust and elegant product
it's not the product that should be insanely great, but the experience of being your user
the product is just one component of that
for a big company it's necessarily the dominant one
can, perhaps, but should? yes
over-engaging with early users is not just a permissible technique for getting growth rolling
making a better mousetrap is not an atomic operation
the feedback you get from engaging directly with your earliest users will be the best you ever get
sometimes the right unscalable trick is to focus on a deliberately narrow market
it's like keeping a fire contained at first to get it really hot before adding more logs
that's what facebook did
at first it was just for harvard students
most startups that use the contained fire strategy do it unconsciously
the strategy works just as well if you do it unconsciously
among companies, the best early adopters are usually other startups
plus when they succeed they grow fast, and you with them
they got started by doing something that really doesn't scale: assembling their routers themselves
hardware startups face an obstacle that software startups don't
the minimum order for a factory production run is usually several hundred thousand dollars
the arrival of crowdfunding (or more precisely, preorders) has helped a lot
but even so i'd advise startups to pull a meraki initially if they can
that's what pebble did
the pebbles assembled the first several hundred watches themselves
" who knew?
even if there aren't many of them, there are probably adjacent territories that have more
consulting is the canonical example of work that doesn't scale
that's where companies cross the line
we did that at viaweb
since we would do anything to get users, we did
we felt pretty lame at the time
there's a more extreme variant where you don't just use your software, but are your software
some startups could be entirely manual at first
i should mention one sort of initial tactic that usually doesn't work: the big launch
they want to launch simultaneously in 8 different publications, with embargoes
and on a tuesday, of course, since they read somewhere that's the optimum day to launch something
it's easy to see how little launches matter
think of some successful startups
so why do founders think launches matter? a combination of solipsism and laziness
partnerships too usually don't work
it's not enough just to do something extraordinary initially
you have to make an extraordinary effort initially
y combinator has now funded 564 startups including the current batch, which has 53
7 billion, and the 511 prior to the current batch have collectively raised about $1
as usual those numbers are dominated by a few big winners
the top 10 startups account for 8
6 of that 11
but there is a peloton of younger startups behind them
there are about 40 more that have a shot at being really big
i'd guess we can grow another 2 or 3x before hitting the next bottleneck
one consequence of funding such a large number of startups is that we see trends early
i'm going to take a shot at describing where these trends are leading
i think more
now there's a third: start your own company
that's a big change
i think we're still at the beginning of this one
it's hard to predict how big a deal it will be
as big a deal as the industrial revolution? maybe
probably not
one thing we can say for sure is that there will be a lot more startups
this process is not just something happening now in silicon valley
it started decades ago, and it's happening as far afield as the car industry
it has a long way to run
the other big driver of change is that startups are becoming cheaper to start
which means investors will get less stock and less control
there are still a lot of people who'd make great founders who never end up starting a company
you can see that from how randomly some of the most successful startups got started
there might be 10x or even 50x more good founders out there
high returns don't come from investing at low valuations
they come from investing in the companies that do really well
so if there are more of those to be had each year, the best pickers should have more hits
this means there should be more variability in the vc business
whereas the bad firms will get the leftovers, as they do now, and yet pay a higher price for them
nor do i think it will be a problem that founders keep control of their companies for longer
what about angels? i think there is a lot of opportunity there
it used to suck to be an angel investor
and the days when vcs could wash angels out of the cap table are long gone
few investors understand the cost that raising money from them imposes on startups
and in this context, low-cost means deciding quickly
one is that the scariness of starting a startup in the old days was a pretty effective filter
now that the cost of failing is becoming lower, we should expect founders to do it more
that's not a bad thing
it will be interesting, in a bad way, if idea clashes become a lot more common
what used to be an obelisk will become a pyramid
it will be a little wider at the top, but a lot wider at the bottom
imagine the obelisk of investors that corresponds to the obelisk of startups
i think the biggest danger for vcs, and also the biggest opportunity, is at the series a stage
right now, vcs often knowingly invest too much money at the series a stage
some vcs lie and claim the company really needs that much
like a lot of bad things, this didn't happen intentionally
the vc business backed into it as their initial assumptions gradually became obsolete
what will happen to the vc business when that happens? hell if i know
but i bet that particular firm will end up ahead
and that's where the money is
you can't fight market forces forever
40% used to be common
now vcs are fighting to hold the line at 20%
but i am daily waiting for the line to collapse
it's going to happen
you may as well anticipate it, and look bold
who knows, maybe vcs will make more money by doing the right thing
it wouldn't be the first time that happened
venture capital is a business where occasional big successes generate hundredfold returns
if you want to find new opportunities for investing, look for things founders complain about
founders are your customers, and the things they complain about are unsatisfied demand
but the more general recipe is: do something founders want
the way to get startup ideas is not to try to think of startup ideas
it's to look for problems, preferably problems you have yourself
microsoft, apple, yahoo, google, and facebook all began this way
it sounds obvious to say you should only work on problems that exist
and yet by far the most common mistake startups make is to solve problems no one has
i made it myself
in 1995 i started a company to put art galleries online
but galleries didn't want to be online
it's not how the art business works
so why did i spend 6 months working on this stupid idea? because i didn't pay attention to users