Output of classification layer

  • Can last layer (classification layer) output can be negative?,bcz I am getting all values as negative

  • My last layer looks like (batchnorm->dropout->Linear)

Yes, it can be negative, if the last layer output can be understood as logits, which are not bounded.

Thanks @ptrblck for reply, I have heard about softmax function in classification, I am very new to this .from author of my GitHub repo I have confirmed that he is using softmax in cross entropy loss , as softmax fcn outputs will be in probability, but the value I am getting are integer, floating point values

My concern is does(softmax) is included in very last layer as I am getting non probability values

This would be wrong, since nn.CrossEntropyLoss expects raw logits and applies log_softmax internally as described in the docs.

I have read the docs , but my confusion is when I printed the output from the base code and the output from the one which I have altered the code both the output is in floating point
have a look into both outputs sample

  • output from the base code:
    16.696354 8.354133 10.186245 11.498075 12.300736 10.866700 11.166842
    9.032269 10.319295 7.855459 9.150773 6.944067 11.078278 9.090258
    7.000237 9.369949 7.972084 10.183696 10.354758 9.057864 7.839106
    9.350568 8.339901 10.578559 8.151072 6.615736 10.325701 7.763713
    9.784429 13.697207 10.587792 7.794194 9.910049 10.466525 10.924786
    11.512972 12.069916 8.615462 11.006269 11.574995 9.244633 9.231817
    9.324425 12.565766 10.593280 8.469263 8.870036 11.072852 10.698648
    11.417478 12.453324 11.991568 8.204532 8.595074 9.544779 6.938322
    9.163651 8.716043 11.082959 9.219058 10.724289 11.477286 11.559748
    11.386333 10.270207 8.702656 10.115452 9.487432 8.977314 9.583576
    7.993706 10.435097 10.116531 10.186015 9.529931 11.199296 9.484911
    9.646361 7.954441 8.351682 8.918447 8.052635 9.389923 8.473695 8.584301
    9.649491 10.457809 9.019952 8.396974 11.244998 6.340092 9.839185
    6.674132 10.418262 7.842873 6.073377 8.398934 10.016559 7.708073
    9.683187 9.297018 7.753638 8.203460 13.838176 10.963732 10.340004
    11.344488 9.076180 7.599188 6.947826 7.193683 5.522867 10.630272
    9.558903 9.628851 6.170614 9.047945 7.087698 11.783425 12.145776
    11.271029 9.954466 11.373574 10.642700 11.845484 9.974299 11.123785
    6.554690 8.252899 11.271506 5.816365 9.478853 8.866497 8.868212

  • output from the modified code:
    -14.924747 -15.466200 -14.091967 -12.780253 -10.942934 -10.649412 -11.797517 -9.700449 -5.488928 -7.536321 -10.630082 -13.750564 -10.921607 -9.393652 -14.469529 -9.283759 -8.825542 -11.879877 -10.629101 -11.310738 -7.375803 -9.345245 -11.384661 -7.627495 -9.068569 -11.338547 -10.864298 -11.547069 -12.373827 -13.071493 -10.939083 -9.916439 -8.749317 -9.801317 -9.856300 -10.900458 -10.874573 -11.667508 -9.267649 -8.144867 -9.818483 -8.629480 -8.891129 -8.721351 -9.278702 -9.894162 -10.265675 -10.583538 -6.523682 -7.911346 -10.026297 -10.141512 -10.514209 -11.701536 -8.204363 -12.029481 -9.373199 -11.994194 -9.822119 -10.543645 -6.892629 -8.988424 -8.302072 -9.932587 -11.056336 -10.489428 -6.542980 -5.797212 -7.184329 -10.637536 -11.578483 -8.901155 -14.063570 -9.878801 -12.068350 -10.989915 -9.141111 -8.553189 -10.079253 -12.481957 -7.441250 -5.653161 -4.582238 -7.205393 -11.772191 -5.400904 -4.785841 -15.616782 -15.108768 -15.460314 -14.476255 -9.388381 -12.002260 -10.625971 -12.178844 -13.565306 -12.647863 -9.406588 -8.665648 -7.453368 -10.149251 -9.376029 -6.375273 -8.216988 -3.747476 -11.429441 -4.374193 -15.604350 -11.742348 -11.518512 -9.860221 -13.548150 -11.518255 -12.010603 -9.612392 -12.391186 -11.025039 -13.260274 -13.135287 -10.671009 -11.138130 -14.439317 -15.647364 -13.423687 -11.016035 -11.076318 -10.595095 -12.421420 -8.869572 -14.374072 -12.589520 -12.590418 -13.917626 -6.548331 -9.402328 -7.252759 -12.496483 -10.553160 -6.649272 -9.539070 -8.899148 -8.414417 -7.749596 -8.681293 -11.269684 -9.499310 -9.282102 -12.725037 -14.374966 -13.139431 -6.361098 -8.762877 -11.736611 -13.809862 -11.898018 -10.444094 -10.377052 -12.177114 -11.741683 -8.074329 -8.566818 -8.870081 -9.658258 -7.284324 -9.309556 -9.178699 -9.968216 -8.615371 -6.829469 -9.614569 -7.418700 -9.835848 -7.022779 -8.463126 -9.525493 -8.248149 -8.402008 -8.429467 -10.062819 -8.570545 -8.131669 -9.946007 -5.550721 -10.329622 -5.090342 -7.400333 -6.980797 -10.276329 -10.533189 -8.035837 -12.308578 -6.216680 -6.797091 -8.801431 -9.139558 -10.934214 -10.800615 -10.523451 -10.312401 -10.993496 -9.132079 -9.877302 -6.710165 -11.656191 -10.335322 -9.267550 -6.245172 -8.164507 -8.352470 -3.734375 -6.250959 -8.149489 -9.279354 -7.631793 -10.807693 -9.299812 -10.540572 -9.571306 -10.000259 -8.977747 -8.365076 -7.361765 -9.812961 -8.963720 -9.900577 -8.727519 -8.058542 -6.778884 -10.297823 -11.197148 -11.018446 -8.915452 -9.868874 -8.807567 -9.374204 -8.760573 -9.539266 -10.380879 -7.833130 -9.954685 -9.088131 -9.076381 -7.135726 -8.439505 -8.061871 -8.956904 -9.325583 -9.154071 -9.483627 -8.745210 -8.655258 -14.193750 -10.370861 -8.847367 -12.668102 -7.378061 -7.747254 -11.355366 -12.395138 -10.978392 -9.658841 -12.315838 -8.641911 -8.963852 -7.081150 -8.518521 -7.924654 -6.639360 -10.876872 -4.952968 -8.172203 -4.728394 -3.206112 -4.527473 -3.656051 -6.767284 -4.481569 -4.636072 -4.956150 -8.068607 -5.028025 -7.217319 -5.381607 -11.262135 -12.125610 -7.436188 -4.850339 -2.634767 -8.301994 -8.323124 -8.646851 -5.811331 -7.645202 -6.816438 -3.910469 -6.938224 -10.880302 -8.188984 -3.614112 -4.756909 -13.944672 -14.779960 -12.673211 -11.902866 -12.565957 -8.753345 -12.873251 -10.761095 -11.678123 -12.109736 -10.039812 -10.342909 -8.920776 -12.287541 -11.339806 -13.001688 -11.156058 -12.274959 -10.898190 -14.415215 -13.280413 -10.885313 -9.638103 -14.073153 -14.965272 -13.225948 -11.913578 -12.082425 -13.203942 -11.471396 -2.536255 -3.106779 -10.681178 -11.821568 -6.481144 -7.930390 -4.961690 -4.249408 -8.822718 -8.906812 -13.028990 -4.173177 -3.583350 -5.469178 -8.833405 -7.385776 -9.465814 -7.544590 -4.627764 -3.210952 -2.667873 -8.153784 -7.733531 -7.305910 -7.062289 -5.961103 -3.867132 -3.744091 -6.658306 -8.747190 -4.763302 -10.789669 -6.648223 -7.563812 -9.288377 -8.242213 -9.563098 -10.405249 -10.092116 -11.616938 -9.915546 -6.373425 -6.301728 -7.440125 -9.262321 -12.301723 -10.759499 -9.127765 -9.857555 -8.501636 -8.966943 -9.586206 -10.818542 -10.006932 -10.243494 -8.946587 -8.786690 -9.755868 -12.388198 -14.009087 -11.471832 -14.985362 -12.856163 -12.648767 -12.561129 -13.447538 -13.715219 -11.173344 -15.175369 -14.045271 -16.329483 -16.013863 -16.287748 -17.556126 -17.683088 -17.562172 -15.501487 -14.216606 -16.449207 -16.305283 -14.290252 -15.827917 -13.059809 -14.783245 -17.417212 -11.637590 -15.914572 -17.948799 -15.202210 -13.442911 -15.459244 -11.509146 -14.732383 -14.231590 -16.000927 -13.920401 -17.378721 -11.810421 -10.332609 -14.913646 -16.022541 -14.412118 -16.449806 -14.003426 -13.562130 -13.245970 -13.504446 -14.720572 -14.356732 -16.562710 -14.018814 -15.785743 -14.515291 -16.529911 -15.456488 -13.507667 -17.667509 -14.998732 -12.968830 -15.023366 -16.444859 -16.983133 -14.893880 -13.679313 -16.517597 -16.192892 -13.960319 -15.262298 -13.594189 -13.298163 -10.055788 -13.504677 -11.535253 -10.455103 -15.427880 -15.268770 -17.751974 -12.744367 -15.434336 -15.086503 -15.688097 -13.278584 -13.510065 -16.123381 -15.317583 -18.544483 -16.954830 -16.877184 -12.827106 -13.878499 -16.647968 -16.119484 -16.069239 -13.749084 -14.952330 -16.544378 -16.331615 -14.983135 -10.019301 -12.713968 -17.034105 -11.748071 -12.847789 -14.191525 -15.166779 -15.098945 -16.597725 -14.984001 -16.842037 -14.210443 -3.994588 -11.755802 -12.941812 -17.043238 -15.805686 -14.094334 -11.313598 -15.448820 -12.713236 -14.092683 -17.172264 -14.526143 -14.327169 -16.495207 -11.689473 -13.218109 -13.359829 -15.569403 -15.485486 -13.782365 -14.672580 -16.908058 -13.781730 -13.943287 -15.071729 -11.219647 -15.807961 -17.094788 -16.973505 -15.510705 -17.217312 -16.563904 -14.057548 -14.620627 -13.291373 -15.400139 -17.601667 -13.951403 -15.412293 -12.208667 -16.770790 -14.838970 -15.623247 -13.713880 -14.956791 -14.447270 -15.261017 -16.233255 -13.455299 -16.164413 -16.794151 -14.346299 -14.076628 -13.458548 -16.030342 -14.776783 -13.828875 -16.590767 -13.598618 -13.683124 -17.372005 -16.355446 -12.329210 -16.389822 -15.037085 -16.653072 -15.298490 -14.431192 -10.359897 -14.227702 -15.409325 -15.583483 -14.701551 -16.299706 -16.609182 -15.871837 -16.274740 -13.722259 -12.009333 -16.923668 -16.713291 -17.813599 -13.814348 -15.164921 -14.733175 -15.364494 -16.273727 -12.132923 -12.496256 -14.757327 -16.240089 -16.217939 -17.427959 -15.209174 -16.402031 -15.516324 -9.999450 -15.521080 -16.261309 -10.625113 -9.990450 -13.711271 -16.747551 -13.999131 -15.584837 -15.091353 -13.826774 -15.493654 -16.816761 -11.289042 -15.288116 -13.656199 -16.699575 -17.325596 -15.724781 -16.081522 -10.036371 -16.057236 -13.293665 -15.516121 -13.940322 -14.777867 -13.760667 -15.124284 -14.565156 -17.301191 -14.854319 -15.412807 -16.506050 -17.174356 -14.326185 -16.525164 -17.266575 -15.262438 -11.405724 -15.925804 -14.577033 -13.891166 -13.457174 -13.115597 -14.868482 -14.573133 -15.689346 -13.570167 -13.522936 -16.177917 -12.600599 -15.828815 -14.794708 -8.565349 -16.558878 -16.092207 -13.941723 -12.448706 -14.069025 -14.283752 -13.536417 -16.709690 -14.044134 -13.660127 -16.497889 -16.209774 -18.131630 -11.938896 -17.382013 -16.195738 -11.771418 -17.451641 -14.979555 -15.264374 -15.289687 -12.284507 -14.857910 -14.617554 -11.055576 -15.393182 -11.440231 -10.532907 -14.308743 -15.625945 -15.355043 -16.133808 -14.522883 -16.133356 -15.391905 -16.635939 -16.201775 -16.820271 -19.180056 -14.767385 -13.452611 -17.063494 -15.419271 -13.063520 -16.663767 -14.194442 -13.001938 -14.886726 -13.121859 -14.095379 -10.794671 -16.667452 -15.893229 -13.690815 -16.401245 -16.749512 -14.404078 -16.119560 -13.941700 -18.240652 -14.595492 -15.628439 -16.139189 -17.149364 -15.221456 -17.134888 -15.411414 -13.280542 -13.855592 -14.246922 -15.274901 -14.927471 -12.339780 -16.043093 -16.848909 -13.910503 -11.039851 -17.996754 -10.775003 -16.052113 -10.306599 -13.866508 -16.768021 -13.570416 -14.026373 -16.066896 -16.075094 -15.315802 -13.861789 -14.631765 -14.476483 -14.152034 -14.914989 -13.616934 -16.716745 -17.878870 -15.367173 -16.599150 -16.459625 -11.691515 -11.162869 -14.117721 -16.174500 -12.001650 -16.938999 -16.032793 -13.640858 -15.066032 -14.724764 -17.320923 -15.416000 -14.484576 -15.333757 -16.332952 -13.985105 -12.324265 -14.344248 -16.761169 -15.051623 -13.872671 -15.248655 -13.365808 -15.349960 -15.512327 -14.575577 -13.600128 -14.881839 -16.250458 -15.436363 -16.337019 -15.443115 -16.325731 -16.283978 -12.920462 -13.511777 -16.836449 -14.803444 -13.924556 -15.188480 -14.752589 -14.223919 -13.922435 -9.736076 -14.670116 -13.519324 -15.400826 -14.723646 -14.603733 -18.158363 -14.527349 -15.580069 -13.561855 -14.472797 -14.492686 -14.990891 -9.463333 -14.346565 -15.543454 -13.904713 -16.581446 -15.942359 -13.240873 -16.875937 -12.821934 -16.471008 -9.993293 -13.560874 -14.505864 -16.668119 -17.046587 -16.653877 -12.887343 -17.004862 -15.269484 -13.282369 -9.391254 -16.880291 -15.294439 -14.508626 -14.769830 -13.252235 -14.875162 -14.232914 -15.717939 -15.871151 -13.081653 -14.961360 -12.891455 -14.565245 -15.730962 -12.432698 -14.308691 -14.477907 -13.744644 -13.152027 -12.292141 -15.972500 -16.185087 -16.977654 -14.640766 -11.880442 -15.397479 -9.172331 -10.901905 -17.784103 -15.358916 -14.418108 -14.783550 -12.764915 -13.314507 -15.097549 -13.389450 -16.893101 -15.468257 -14.121752 -16.369946 -14.235095 -15.257570 -16.500315 -15.429686 -13.931216 -14.115238 -14.009226 -12.829984 -14.801979 -16.181328 -11.680122 -16.288918 -16.139582 -12.950057 -13.602263 -16.861778 -16.206057 -16.293152 -10.044254 -13.425289 -16.744982 -14.155113 -12.707730 -16.422230 -16.903107 -16.276421 -16.918238 -15.632189 -14.582255 -15.972803 -13.822903 -15.855991 -13.034044 -12.601211 -17.187826 -15.219545 -14.338232 -13.602494 -13.258731 -15.450686 -16.826397 -14.417507 -17.302547 -15.020874 -11.843822 -11.334448 -11.427258 -11.557845 -14.098431 -14.266617 -15.922088 -16.130583 -16.507290 -15.977484 -18.335272 -16.410116 -17.011263 -15.830215 -15.709799 -16.920029 -16.369446 -14.541973 -14.451397 -14.282175 -10.935634 -11.527729 -13.117249 -14.094624 -16.407276 -16.521786 -15.359726 -15.556465 -16.334063 -17.345928 -15.655510 -16.815754 -15.907859 -17.823589 -15.725850 -16.034416 -14.231002 -12.035696 -14.049395 -17.029125 -14.739464 -15.890388 -14.849380 -15.630312 -15.469090 -14.404512 -15.501282 -14.754938 -8.552861 -16.306231 -14.620805 -11.670365 -14.201248 -14.540195 -14.415812 -13.270891 -16.799242 -17.196709 -14.639233 -15.743847 -11.281099 -13.854280 -6.661140 -11.524736 -11.046971 -11.081345 -9.627752 -11.343790 -10.396233 -9.265203 -12.217793 -15.780461 -14.650061 -15.697147 -14.612324 -16.566105 -11.384941 -12.146500 -10.859949 -14.271595 -14.183656 -10.945687 -14.114749 -10.136223 -11.634193 -10.219763 -8.740107 -11.290864 -12.586761 -12.923983
    -16.763243 -16.890490 -18.021507 -14.644262 -13.728392 -11.402923 -14.536324 -18.673357 -16.177855 -18.567839 -18.135811 -17.218254 -19.126945 -16.980555 -19.902220 -18.453236 -18.134516 -18.552219 -16.571943 -16.751057 -16.801752 -18.670507 -19.178089 -16.922516 -16.509493 -16.789028 -14.717791 -17.306110 -17.202236 -12.919407 -14.924429 -13.757147 -13.200064 -12.647011 -15.254006 -15.489012 -14.338945 -15.813309 -12.495703 -17.002052 -16.529444 -15.075502 -16.414036 -16.940893 -14.976490 -17.224882 -14.466128 -16.503473 -16.911596 -16.309935 -16.510052 -16.325794 -13.312078 -14.530255 -11.747141 -14.249282 -12.063974 -15.306383 -14.833176 -15.537145 -11.475796 -12.898900 -13.053956 -15.204569 -14.986007 -9.261724 -11.746554 -10.765564 -11.620901 -15.158666 -15.262636 -14.950237 -16.092012 -15.191600 -15.700460 -16.958969 -13.018716 -12.603831 -16.091656 -13.624842 -18.894297 -14.813335 -14.123769 -16.479660 -18.013628 -14.768584 -15.686483 -22.131634 -20.849827 -18.801840 -19.335733 -19.195398 -17.565914 -18.121979 -18.035131 -19.902901 -18.638023 -17.529510 -20.396984 -16.987806 -18.603764 -16.107569 -15.300419 -15.297280 -16.055225 -14.662899 -16.907455 -12.938815 -8.890848 -8.464900 -7.663523 -13.391895 -9.070933 -13.743924 -13.790480 -7.117934 -10.772388 -12.616854 -13.256331 -11.882376 -13.385836 -14.269058 -18.646379 -13.406191 -11.435971 -12.485291 -12.137283 -19.683775 -17.830370 -19.490055 -20.315453 -18.136869 -19.113026 -15.141182 -16.718241 -16.194780 -19.900518 -19.608669 -17.473057 -15.461645 -13.788025 -16.879482 -15.645400 -17.209230 -17.547554 -17.489399 -16.862291 -19.103104 -18.374115 -17.934137 -16.085190 -14.594181 -18.090843 -19.384176 -17.331327 -17.255205 -16.788029 -17.418978 -17.723097 -18.689104 -19.171030 -17.733980 -15.289856 -16.401236 -18.004633 -19.927538 -17.122375 -17.844595 -17.767162 -17.759647 -19.274738 -17.755394 -17.500387 -16.901829 -16.256639 -18.524544 -16.068287 -19.917038 -17.530457 -17.713045 -17.751301 -19.344591 -17.068825 -19.367737 -17.288296 -17.379831 -17.654610 -18.295191 -18.610550 -17.361288 -20.081890 -16.946634 -16.674395 -18.122980 -19.539888 -16.628736 -16.475773 -19.665506 -18.805183 -17.869360 -17.057289 -15.031070 -17.579895 -17.249104 -16.615973 -18.064157 -18.005842 -16.192715 -14.691891 -17.355419 -18.506218 -18.792879 -16.689636 -18.218018 -19.731714 -16.777662 -19.207644 -14.739456 -16.097727 -13.710624 -17.670969 -16.525551 -16.565390 -19.819920 -19.202824 -18.931068 -19.585571 -15.934434 -19.412874 -18.858952 -17.126762 -15.400593 -15.159845 -18.285694 -17.458088 -15.774011 -20.499281 -17.845665 -19.037909 -18.760139 -17.300623 -17.646780 -18.499975 -18.173429 -17.047445 -16.341627 -18.790712 -17.745327 -13.882981 -13.408959 -14.039886 -16.160475 -19.633350 -16.942152 -15.457841 -18.570663 -15.883767 -17.877792 -18.368732 -16.557766 -18.054237 -16.970867 -19.256750 -14.832544 -13.445218 -16.167143 -17.859409 -16.553417 -20.208591 -14.423001 -17.880877 -15.141807 -15.405729 -15.166798 -17.137514 -14.718473 -15.537820 -16.014071 -15.690432 -15.324417 -14.522492 -11.288151 -11.401792 -16.535816 -14.108891 -11.846670 -13.620148 -12.415599 -11.410376 -11.884963 -11.031993 -14.516517 -13.509844 -10.411520 -17.281265 -17.547262 -18.215200 -18.852427 -15.668831 -15.694826 -14.836910 -16.216230 -15.078492 -15.445661 -14.066557 -14.688837 -17.252644 -13.509645 -14.226533 -12.258636 -12.854790 -15.337952 -14.362237 -16.792217 -14.773577 -16.735832 -18.165026 -15.481066 -15.855344 -17.292963 -16.202232 -17.503540 -15.867451 -18.240261 -15.898302 -17.883593 -16.229132 -9.992508 -9.570434 -8.570876 -13.763825 -15.086296 -18.384682 -15.120881 -13.474211 -18.876457 -17.888618 -16.042225 -15.408412 -20.574207 -16.086761 -14.746696 -14.886427 -17.509354 -16.784948 -16.937370 -18.040522 -17.748957 -13.862078 -15.720701 -16.308445 -17.896620 -15.772647 -15.906618 -18.668283 -15.524738 -12.995296 -14.542306 -14.535398 -14.823059 -14.796584 -13.742981 -12.524076 -13.977599 -16.065884 -16.525560 -17.529041 -19.852489 -15.950157 -19.176266 -17.051691 -18.028692 -17.164291 -17.547020 -16.646130 -15.851110 -19.667963 -16.747356 -17.726372 -16.007069 -16.567921 -16.992180 -17.871326 -15.206941 -14.774897 -18.568180 -17.565628 -14.091531 -14.944059 -16.805357 -8.373699 -14.405281 -13.211248 -11.067488 -16.631880 -14.335471 -10.453241 -7.905231 -17.991209 -22.346836 -19.708250 -18.849344 -20.433451 -17.365690 -21.842514 -20.992739 -19.236786 -19.015575 -18.808372 -18.562740 -14.131523 -19.185692 -19.000069 -18.396957 -18.459923 -14.089327 -20.706408 -20.469065 -19.567451 -18.154028 -19.844196 -18.032923 -20.291138 -19.229292 -20.117130 -18.731516 -20.698963 -18.918621 -16.671625 -17.281189 -20.682594 -19.434891 -18.580498 -19.358669 -16.812944 -18.670870 -17.840485 -17.811749 -19.156414 -21.939861 -17.949535 -18.796818 -20.463898 -18.341700 -21.754490 -19.626854 -20.358725 -19.631149 -17.596115 -19.001621 -23.164064 -18.651552 -16.142365 -18.535309 -18.789486 -16.656094 -20.359055 -16.422651 -19.360792 -18.368126 -15.751359 -18.827003 -17.932354 -16.606312 -15.365582 -19.917229 -22.498318 -17.710274 -20.151470 -16.635948 -18.032404 -17.307314 -19.796822 -17.921154 -16.226040 -22.184042 -17.100201 -19.873106 -17.101768 -16.426086 -20.722061 -21.046179 -22.265852 -18.486328 -16.416124 -20.876930 -21.809624 -18.322792 -11.122483 -15.134836 -14.738531 -21.947678 -20.238800 -19.704845 -18.182087 -17.786983 -17.736483 -17.177528 -18.750681 -16.941931 -18.462305 -18.495680 -14.628434 -19.442089 -17.969429 -17.629992 -12.921337 -18.912485 -15.879210 -14.612875 -18.228086 -19.105591 -18.004036 -19.767372 -17.795769 -16.371281 -18.833431 -20.040321 -19.652231 -19.725445 -18.548649 -17.892473 -22.034122 -19.059727 -19.383947 -17.537374 -18.179838 -19.854698 -18.399071 -18.648825 -19.876348 -20.913645 -17.563745 -13.497384 -18.977310 -19.402473 -19.039173 -18.986713 -17.700108 -15.491127 -20.121655 -19.286205 -16.918135 -17.187777 -16.216082 -19.161930 -20.357840 -18.591778 -17.102230 -18.643852 -18.867241 -19.116753 -15.630161 -19.698183 -20.084078 -18.858112 -18.296860 -18.836681 -15.758348 -18.400877 -20.499414 -21.577984 -14.980241 -18.837540 -20.350895 -19.653114 -17.188801 -13.508855 -14.405213 -18.929567 -20.229113 -21.086571 -16.785484 -21.337280 -18.355652 -18.727737 -21.237152 -20.003387 -19.452383 -21.820932 -18.576206 -17.755199 -14.261152 -21.059483 -16.012939 -19.743402 -19.279882 -17.829319 -18.512596 -17.772747 -20.360973 -17.295835 -21.245022 -19.418491 -19.228218 -20.711609 -17.440748 -19.912403 -18.037792 -10.974897 -16.492027 -18.828403 -22.285616 -21.699150 -19.200157 -20.918079 -19.998140 -18.907261 -18.785543 -17.712982 -21.865376 -13.946846 -22.955784 -20.591808 -20.278761 -21.166294 -12.918066 -21.065630 -14.018703 -18.189503 -17.206453 -19.147446 -17.411253 -17.744141 -18.082157 -21.148300 -17.722246 -18.768738 -18.555704 -19.113699 -18.913383 -19.028965 -19.825096 -17.494123 -16.762751 -19.069380 -18.839005 -19.398876 -19.098324 -18.524876 -14.711880 -19.024900 -20.956863 -14.081232 -14.347666 -21.520842 -15.929954 -18.936077 -19.546396 -16.306889 -18.469278 -19.934744 -20.429106 -18.925768 -17.947105 -20.716944 -18.017645 -16.586479 -15.181363 -16.293146 -19.459284

Logits are represented as floating point numbers in the range [-Inf, Inf].
If you want to get the class predictions, you can use torch.argmax(output, dim=1).

yeah I am using torch.max(output,1) for getting class prediction, I have evaluated for 5000 images , accuracy of prediction is same as what i was getting before(from base code)

but my concern is can output be negative? if it soo I can move further

outputs can contain negative values, as explained before. The output of torch.argmax should not contain negative values.

thanks @ptrblck, yeah as torch.max() gives the img class it cant be negative, I am not getting negative value for torch.max